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,13 +158,20 @@ int myapp_run(myconf_t* myconf)
|
|||
c.ha.defer_config_fetch = false;
|
||||
}
|
||||
|
||||
/* Standby: fetch config from primary before Phase 2 */
|
||||
/* Standby: fetch config from primary before Phase 2.
|
||||
* Skip if this node already has a valid local config (ground-truth
|
||||
* nodes should not fetch from primary — they ARE the ground truth). */
|
||||
if (myconf->config_version_tag == 0) {
|
||||
rc = fetch_config_from_primary(&c);
|
||||
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(). */
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue