feat(ha-config-bootstrap): implement ha_find_and_connect_to_primary three-tier discovery (task 9.2)

This commit is contained in:
Rongsong Shen 2026-05-28 15:09:08 +00:00
parent 3252c89e7a
commit 97a76617e6
6 changed files with 428 additions and 1 deletions

View file

@ -206,7 +206,7 @@ Dependency order: startup validation (D) unblocks vtaskmgr before election (A);
- _Requirements: 6.5_
- _Boundary: Persistence Layer (persist.c) / WAL replay_
- [ ] 9.2 Implement ha_find_and_connect_to_primary() with three-tier discovery
- [x] 9.2 Implement ha_find_and_connect_to_primary() with three-tier discovery
- Tier 1: if `ha.voted_for_name` set → direct connect; on `XCE_ERR_NOT_READY` → backoff, retry Tier 1
- Tier 2: probe remaining peers; follow `XCE_ERR_STANDBY` `redirect_host/port` immediately
- Tier 3: blind sequential scan with 100ms→5s exponential backoff