feat(ha-config-bootstrap): implement repl_wait_majority_ack with quorum formula and ack_op discrimination (task 7.3)

This commit is contained in:
Rongsong Shen 2026-05-28 13:57:24 +00:00
parent 3969064e11
commit 30bcb74a67
3 changed files with 125 additions and 12 deletions

View file

@ -160,7 +160,7 @@ Dependency order: startup validation (D) unblocks vtaskmgr before election (A);
- _Requirements: 5.1, 5.4_
- _Boundary: Replication Layer (repl.c, repl.h)_
- [ ] 7.3 Implement repl_wait_majority_ack()
- [x] 7.3 Implement repl_wait_majority_ack()
- `repl_wait_majority_ack(cluster_t *c, uint32_t timeout_ms, uint8_t ack_op)`: `cond_timedwait` until `acked_count + 1 >= (n_active + 1) / 2`; single-node shortcircuit; `ack_op` disambiguates WAL vs config ACKs; returns 0 on quorum, `-ETIMEDOUT` on timeout
- `repl_on_ack()` extended to decrement `pending_ack_count` and signal condition
- Log INFO on quorum (10.3); log WARN on timeout (10.3)