Skip to content

fix: Candidate does not step down when receiving AppendEntries with log conflict from current-term leader #340

@JoshuaChi

Description

@JoshuaChi

When a candidate receives an AppendEntries RPC from a server whose term equals the
candidate's current term, but the request causes a log conflict, the candidate rejects
the RPC and remains in candidate state instead of transitioning to follower.

This can lead to the candidate eventually timing out and starting a new election at
term+1, which forces the current leader — who is operating correctly — to step down
unnecessarily.

Observed in: cluster membership change scenarios where a node's log is behind the
leader's (e.g., newly joining or recovering nodes).

Affected component: candidate AppendEntries handler

Metadata

Metadata

Assignees

No one assigned

    Labels

    component:raft-consensusCore Raft protocol — leader election, log replication, membership changes.raft-electionLeader election mechanism and related issues

    Type

    Projects

    Status

    In progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions