fix(ha-bootstrap): standby nodes with local config skip fetch — only config_tag=0 nodes fetch from primary
This commit is contained in:
parent
e4e34d8f60
commit
e25d2cc645
1 changed files with 13 additions and 6 deletions
|
|
@ -158,12 +158,19 @@ int myapp_run(myconf_t* myconf)
|
||||||
c.ha.defer_config_fetch = false;
|
c.ha.defer_config_fetch = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Standby: fetch config from primary before Phase 2 */
|
/* Standby: fetch config from primary before Phase 2.
|
||||||
rc = fetch_config_from_primary(&c);
|
* Skip if this node already has a valid local config (ground-truth
|
||||||
if (rc != 0) {
|
* nodes should not fetch from primary — they ARE the ground truth). */
|
||||||
cluster_fini(&c);
|
if (myconf->config_version_tag == 0) {
|
||||||
myconf_fini(myconf);
|
rc = fetch_config_from_primary(&c);
|
||||||
return rc;
|
if (rc != 0) {
|
||||||
|
cluster_fini(&c);
|
||||||
|
myconf_fini(myconf);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
INFO("Standby has local config (tag=%016llx) — skipping fetch from primary",
|
||||||
|
(unsigned long long)myconf->config_version_tag);
|
||||||
}
|
}
|
||||||
/* Role stays CTRL_STANDBY — already set by ha_init(). */
|
/* Role stays CTRL_STANDBY — already set by ha_init(). */
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue