test(raft-log-replication): close Req 8.3 node-restart with sim restart primitive
raft_sim_restart_node models a process restart: the durable in-memory log[] (WAL) and persisted (term, voted_for) survive, while volatile consensus state is cleared by re-running raft_init (returns the node to FOLLOWER). Callbacks, ctx, idx, and partition flag are preserved. test_sim_9_5_node_restart_resumes_replication restarts a follower mid-replication (partial 2-of-3 log), asserts the log survived (load-bearing: log_count==2 would fail if wiped), role/term restored, then replication resumes and converges with Log Matching. Closes the 8.3 'node restart while replication proceeds' sub-clause (8/8 requirement sections now fully covered). ASAN green (220 tests).
This commit is contained in:
parent
0dbccf4b0a
commit
3d6dc9cc56
4 changed files with 116 additions and 1 deletions
|
|
@ -201,5 +201,5 @@
|
|||
## Implementation Notes
|
||||
|
||||
- **Validation (2026-06-21): GO.** Clean ASAN build green from scratch (`xce-build.sh lib`, Fail 0); 8/8 requirement sections covered (40/41 acceptance criteria); boundary ALIGNED (no controller files; no commit advance / vote freshness / transport I/O / entry-bytes in library state); out-of-scope items confirmed absent.
|
||||
- **Known minor gap — Req 8.3 "node restart while replication proceeds" (PARTIAL):** drop/dup/reorder are fully covered by 9.3, and the `initial_log_len` restore primitive is tested at init; 9.4's stale-rejoin covers the equivalent observable state. But no dedicated simulator test chains "restart a sim node mid-replication (re-init from restored log_len) then resume AE delivery" — the sim has no in-place single-node restart helper. Low risk; a follow-up could add a `raft_sim_restart_node` + test to close it strictly.
|
||||
- **Req 8.3 "node restart while replication proceeds" — CLOSED (2026-06-21):** added `raft_sim_restart_node` (durable log[]/(term,voted_for) survive; volatile consensus state cleared via raft_init → FOLLOWER) + `test_sim_9_5_node_restart_resumes_replication` (restart a follower mid-replication with a partial log; assert log_count preserved — load-bearing: would fail if the log were wiped — role/term restored, replication resumes, Log Matching holds). drop/dup/reorder remain covered by 9.3. All 8/8 sections now fully covered.
|
||||
- **Adapter invariant (from validation LOW note):** the AE accept already-have branch treats `on_get_entry_term(index) == entry_term` as a match, which is also true when both are 0. A correct leader never sends `entry_term == 0` for a real entry (`raft_log_append` stamps `s->term >= 1`), so this is safe in-library — but the controller adapter (raft-commit-safety) MUST guarantee it never delivers `entry_term == 0` with `entries_len == 1`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue