test(ha-convergence-recovery): RED ACK-driven catch-up continuation tests + seam (task 4.1)

This commit is contained in:
Rongsong Shen 2026-06-14 05:16:54 +00:00
parent 63c12461a5
commit c2221077ff
6 changed files with 566 additions and 1 deletions

View file

@ -46,7 +46,7 @@
- _Requirements: 2.1, 2.2, 2.3_
- [ ] 4. ACK-driven catch-up continuation and re-inclusion trigger
- [ ] 4.1 Write RED tests for continuation, single-flight, and parity re-inclusion
- [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