Skip to content

fix: raft replication match_index regression and stale truncation term#380

Merged
kacy merged 3 commits intomainfrom
fix/cluster-bugs
Apr 2, 2026
Merged

fix: raft replication match_index regression and stale truncation term#380
kacy merged 3 commits intomainfrom
fix/cluster-bugs

Conversation

@kacy
Copy link
Copy Markdown
Owner

@kacy kacy commented Apr 2, 2026

Summary

  • enforce match_index monotonicity in handleAppendEntriesReply — stale/reordered replies can no longer regress a peer's tracked replication state
  • enforce match_index monotonicity in handleInstallSnapshotReply — same protection for snapshot RPCs
  • fix stale existing_term usage after log truncation in handleAppendEntries — after truncating conflicting entries, the code was using the pre-truncation term value for the append decision, potentially skipping entries that should be appended

3 regression tests covering: out-of-order reply handling, truncation+append correctness, and snapshot reply monotonicity.

@kacy kacy merged commit 817d81e into main Apr 2, 2026
2 checks passed
@kacy kacy deleted the fix/cluster-bugs branch April 2, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant