feat(ha-convergence-recovery): ACK-driven catch-up continuation + parity re-inclusion (task 4.2)
This commit is contained in:
parent
c2221077ff
commit
ffd08c6472
5 changed files with 243 additions and 22 deletions
|
|
@ -45,14 +45,14 @@
|
|||
- _Depends: 2.2_
|
||||
- _Requirements: 2.1, 2.2, 2.3_
|
||||
|
||||
- [ ] 4. ACK-driven catch-up continuation and re-inclusion trigger
|
||||
- [x] 4. ACK-driven catch-up continuation and re-inclusion trigger
|
||||
- [x] 4.1 Write RED tests for continuation, single-flight, and parity re-inclusion
|
||||
- Create `testsuite/test_convergence_verification.c` and register it in meson
|
||||
- Tests (use the existing `ha_repl_stream_wal_hook` / `xce_wal_stream_request_hook` seams to count streaming invocations): a walAck with `acked_lsn < max(committed_lsn, last_written)` schedules exactly one continuation that streams `[acked_lsn+1, target]` WITHOUT any intervening heartbeat/stateReport dispatch; a second walAck while the continuation is in flight schedules nothing (single-flight); after the continuation completes, the next lagging walAck schedules again; a walAck with `acked_lsn >= target` calls `repl_complete_catchup` and the standby's `in_catch_up` clears; the heartbeat decision path (`ha_dispatch_repl_action_for_standby`) still produces HA_REPL_SEND_SNAPSHOT / HA_REPL_STREAM_WAL decisions unchanged (fallback + snapshot ownership pin)
|
||||
- Observable completion: new cases FAIL (red) — current walAck branch (ha.c:2737-2754 anchor) only records the ACK; `repl_complete_catchup` (repl.c:521) has no production caller
|
||||
- _Requirements: 5.1, 5.2, 5.3, 7.1_
|
||||
|
||||
- [ ] 4.2 Implement the continuation trigger and parity re-inclusion to green
|
||||
- [x] 4.2 Implement the continuation trigger and parity re-inclusion to green
|
||||
- ha.c walAck branch: after `repl_on_ack`, derive target as at ha.c:2727-2732; behind target → schedule the continuation via delaymgr unless the standby's `catchup_inflight` flag is set; at parity → `repl_complete_catchup` (ha-commit-engine wiring propagates the membership re-evaluation)
|
||||
- config_repl.c: continuation task body — re-validate the endpoint against the registry, re-derive target, call `ha_stream_wal_to_standby(ep, wal_path, acked_lsn, target)` (internals untouched), clear `catchup_inflight` on all exit paths
|
||||
- ha.h: per-standby `_Atomic int catchup_inflight` storage with slot identity stable across schedule/run
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue