fix(ha-repl-hardening): n_peers count and single-node safe_lsn (task 6.5)

- Fix ha_start_election_async: ha->n_peers = n_other (other peers),
  not candidates_count (total including self). The standby_converged[]
  array is indexed by peer index, so the bound must be n_other.
- Fix ha_compute_safe_committed_lsn: return self_lsn for n_peers==0
  (prevents WAL truncation on single-node re-election).
- Integration test: 3-node cluster reaches CTRL_PRIMARY via majority
  convergence within ~20s; no degraded-mode WARN in logs.
This commit is contained in:
Rongsong Shen 2026-06-05 07:03:37 +00:00
parent 345d51dd61
commit e10cf9a6fc
2 changed files with 13 additions and 7 deletions

View file

@ -233,7 +233,7 @@
- All tests pass under ASAN
- _Requirements: 4.1, 4.2, 4.3, 4.4_
- [ ] 6.5 Integration test: 3-node startup via majority convergence
- [x] 6.5 Integration test: 3-node startup via majority convergence
- Requires task 5.3 (`committing_timeout_ms=60000`) deployed so timeout does not fire during test
- Deploy via `/xce-deploy-ha`; all 3 nodes start within 15s
- Verify primary enters `CTRL_PRIMARY` via majority-convergence INFO log (not committing timeout WARN)