feat(ha-config-bootstrap): implement bootstrap_config_if_needed() (task 5.3)

- Probe all peers: any tag>0 -> defer_config_fetch=true; all-zero -> proceed;
  none reachable -> exponential backoff 500ms->10s cap with WARN per attempt
- Wire into myapp.c: before ha_wait_for_heartbeat_or_timeout()
- Post-election: defer_config_fetch && CTRL_STANDBY -> fetch_config_from_primary()
- INFO log for all three bootstrap outcomes (Req 10.2)
- XCE_TESTING hook for probe mock; test_ha_bootstrap_support.c installs mock
- 9/9 bootstrap tests GREEN, 141/141 full suite GREEN
This commit is contained in:
Rongsong Shen 2026-05-28 09:48:24 +00:00
parent 0c4a0760d1
commit ab174c8b06
6 changed files with 163 additions and 8 deletions

View file

@ -104,6 +104,7 @@ controller_unit_test_src = [
'testsuite/test_ha_startup.c',
'testsuite/test_ha_election.c',
'testsuite/test_ha_bootstrap.c',
'testsuite/test_ha_bootstrap_support.c',
'startup_validation.c',
'worker.c',
'persist.c',