Skip to content

Answer ReplicatedWithLeaderTerm to an empty AppendEntries after an entry of the sender's term - #311

Merged
sakno merged 3 commits into
dotnet:developfrom
galvesribeiro:fix-empty-append-entries-term
Nov 2, 2026
Merged

sakno merged 3 commits into
dotnet:developfrom
galvesribeiro:fix-empty-append-entries-term

Conversation

@galvesribeiro

Copy link
Copy Markdown
Member

Fixes #309.

A follower answers an empty AppendEntries whose preceding entry is of the sender's term with ReplicatedWithLeaderTerm: its log holds the leader's entries of its term up to there. The leader then counts the answer as committed, so a heartbeat round completes on a majority instead of waiting for every member, and a hanging member's queued rounds no longer hold the lease and writes.

Test: TcpTransportTests.EmptyAppendEntriesAfterEntry gives a follower a log whose last entry is of term 2 and sends it an empty AppendEntries after that entry: from a sender of term 2 the answer is ReplicatedWithLeaderTerm (Replicated without the fix), from a sender of term 3 still Replicated.

The cluster tests pass on Linux.

@sakno sakno added the Lib:Cluster DotNext.Net.Cluster library label Nov 2, 2026
@sakno
sakno merged commit 5a1f389 into dotnet:develop Nov 2, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Lib:Cluster DotNext.Net.Cluster library

Projects

None yet

2 participants