From 8b820055ee080935e43b880209a148933b0c892e Mon Sep 17 00:00:00 2001 From: Rongsong Shen Date: Thu, 30 Jul 2026 04:26:25 +0000 Subject: [PATCH] docs(raft-adapter-conformance): confirm task 7.2 regression coverage, log bug-1484 Verified 190 tests across 8 files cover Requirements 2.4, 3.1-3.4, 4.1, 4.4, 7.1-7.3, 7.5, 8.1-8.4. 1067 tests, 0 failures -- unchanged, zero-diff verification task. Task 7.2's sweep surfaced a real, pre-existing gap (bug-1421, not this feature's fault): no test anywhere drives the real repl_ack_decode_and_dispatch path and asserts term adoption fires for the heartbeat-reply or WAL-NACK term-discovery vectors -- only the config-push vector this feature added (task 2.2) is actually tested. Logged as bug-1484; outside this spec's task list to fix. --- .kiro/specs/raft-adapter-conformance/tasks.md | 3 +- .wolf/buglog.json | 28 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/.kiro/specs/raft-adapter-conformance/tasks.md b/.kiro/specs/raft-adapter-conformance/tasks.md index 4a85ac7f..c92ecd5c 100644 --- a/.kiro/specs/raft-adapter-conformance/tasks.md +++ b/.kiro/specs/raft-adapter-conformance/tasks.md @@ -91,7 +91,7 @@ - _Depends: 5.2_ - _Boundary: test_commit_barrier_rollout.c, test_commit_barrier_reply.c, test_term_safety_adapter.c_ -- [ ] 7.2 (P) Confirm election, replication, and recovery regression coverage is unaffected +- [x] 7.2 (P) Confirm election, replication, and recovery regression coverage is unaffected - Run `test_ha_core_safety.c` (including the new tests from 5.1 and 4.2), `test_ha_vote_send.c` (including the new tests from 3.2), `test_persist_recovery.c`, and `test_config_repl.c` (including the new tests from 2.3; also confirms 2.4's existing timeout/unknown-outcome handling, unchanged) and confirm all pass - Run `test_repl_catchup.c`, `test_repl_unit.c`, `test_repl_majority.c`, and `test_ha_repl_push.c` and confirm all pass, closing the coverage gap for the Requirement 3 retry/backoff/catch-up-streaming-ceiling regression lock (`ha_raft_on_repl_nack`, `repl_start_catchup`, `repl_broadcast`) - Observable: test run output confirms the already-fixed retry/backoff, catch-up streaming ceiling, connect-time vote-failure routing, term-adoption vectors, restart/recovery reconcile, and the new dormant-sender guard all remain correct @@ -121,3 +121,4 @@ - New test-only wrappers exposing a `static` production dispatch function (the `_for_test` pattern, e.g. `peer_ctrl_msg_handler_for_test`, `myreq_handler_for_test`) MUST be wrapped in `#ifdef XCE_TESTING`/`#endif` — the source file compiles into the production binary too, and an unguarded wrapper ships as a new linked symbol in production with zero production purpose. - Task 3.2 (bug-1483, not fixed): driving a PreVote round to `RAFT_PRE_VOTE_LOST` in a unit test (`c==NULL`) without first stubbing `ha_prevote_rearm_liveness_hook` falls through to the real `ha_arm_heartbeat_timeout_vtask`, which callocs into the static `s_liveness_ctx` and never frees it when `c==NULL` short-circuits the scheduling guard. `test_ha_prevote.c`'s existing LOST-path tests already stub-and-reset this hook — any new PreVote-round test that reaches LOST must do the same. - `pre_vote_reply_dispatch` has no `XCE_TESTING` mock-hook seam (unlike `vote_reply_dispatch`'s `xce_vote_reply_hook`) — it calls `raft_on_pre_vote_reply` directly. Tests verifying PreVote routing must assert on `raft_state_t`'s own tally fields (`pre_vote_replies[]`, `pre_votes_granted`, `pre_vote_in_progress`) instead, per `test_ha_prevote.c`'s established technique. +- Task 7.2 (bug-1484, residual gap, NOT fixed — outside this spec's task list): no test anywhere in `testsuite/` drives the real `repl_ack_decode_and_dispatch` path and asserts `raft_on_higher_term_observed` fires for either the heartbeat-reply (ha.c ~6690-6711) or WAL-NACK (ha.c ~6805-6814) term-discovery vector bug-1421 introduced. `test_intake_higher_term_heartbeat_adopts_term` looks like it covers this but actually drives a different AE-request code path. Requirement 7.5's "already verified" premise currently rests on unverified ground for these two vectors specifically (the third, config-push, vector added by this feature IS tested — task 2.2). A future task should add a dedicated test mirroring `test_config_push_reply_higher_term_adopts_and_steps_down`'s pattern for the other two. diff --git a/.wolf/buglog.json b/.wolf/buglog.json index e7cc65b8..83c4625a 100644 --- a/.wolf/buglog.json +++ b/.wolf/buglog.json @@ -14384,5 +14384,33 @@ "related_bugs": [], "occurrences": 1, "last_seen": "2026-07-29T10:20:00Z" + }, + { + "id": "bug-1484", + "timestamp": "2026-07-29T21:10:00Z", + "error_message": "No test anywhere in src/controller/testsuite/ drives the real production dispatch path for either term-discovery vector bug-1421 introduced (heartbeat-reply state-report term adoption, ha.c:6690-6711; WAL-NACK reply_term adoption inside repl_ack_decode_and_dispatch, ha.c:6805-6814) and asserts raft_on_higher_term_observed actually fires. The look-alike test_intake_higher_term_heartbeat_adopts_term (test_term_safety_adapter.c:1232) drives a different code path (ha_consume_append_entries -> raft_on_append_entries_request library-level UpdateTerm, an AE-request vector, not the AE-reply/state-report fallback bug-1421 added). test_persist_recovery.c (cited by design.md line 146 as covering this) has zero term-adoption content -- pure recovery mechanics. test_config_repl.c only covers the NEW config-push term vector added by this feature (Req 7.4), not the pre-existing heartbeat/WAL-NACK vectors.", + "file": "src/controller/ha.c (~6690-6711 heartbeat-reply vector, ~6805-6814 WAL-NACK vector); no test file drives either", + "root_cause": "bug-1421 (heartbeat-reply term-discovery fallback) shipped without a dedicated regression test asserting raft_on_higher_term_observed fires through the real repl_ack_decode_and_dispatch path for either vector -- found during raft-adapter-conformance task 7.2s regression-confirmation sweep, which searched the whole test suite (not just its own 8-file boundary) for `raft_on_higher_term_observed`/`higher_term` callers and found none exercising these two vectors end-to-end.", + "fix": "Not yet fixed. Requirement 7.5 (raft-adapter-conformance) claims these vectors \"already verified for this cluster\" -- that claim currently rests on unverified ground. A fix would add a repl_ack_decode_and_dispatch-level test asserting term adoption fires on (a) a higher-term heartbeat-reply state report and (b) a higher-term WAL-NACK reply, mirroring the pattern task 2.2s test_config_push_reply_higher_term_adopts_and_steps_down already established for the third (config-push) vector.", + "tags": [ + "ha.c", + "raft_on_higher_term_observed", + "repl_ack_decode_and_dispatch", + "term-discovery", + "bug-1421", + "coverage-gap", + "raft-adapter-conformance", + "task-7.2", + "found-not-yet-fixed", + "pre-existing", + "requirement-7.1", + "requirement-7.2", + "requirement-7.5" + ], + "related_bugs": [ + "bug-1421" + ], + "occurrences": 1, + "last_seen": "2026-07-29T21:10:00Z" } ]