Skip to content

fix: handle install_snapshot_rpc in candidate state#607

Merged
kjnilsson merged 1 commit intorabbitmq:mainfrom
specula-org:fix/candidate-install-snapshot-handler
Mar 26, 2026
Merged

fix: handle install_snapshot_rpc in candidate state#607
kjnilsson merged 1 commit intorabbitmq:mainfrom
specula-org:fix/candidate-install-snapshot-handler

Conversation

@Qian-Cheng-nju
Copy link
Copy Markdown
Contributor

Hi, thanks for merging #600!

I noticed that handle_candidate doesn't have a clause for install_snapshot_rpc. If a lagging node becomes a candidate while the leader is trying to send it a snapshot, the snapshot message gets dropped and the candidate keeps running elections it can't win — its log is too far behind. Meanwhile the leader keeps trying to send the snapshot, which keeps getting ignored.

The fix adds an install_snapshot_rpc clause to handle_candidate that steps down to follower first (since only a valid leader sends snapshots), then processes the snapshot normally.

@kjnilsson kjnilsson merged commit 29a149a into rabbitmq:main Mar 26, 2026
7 checks passed
@kjnilsson
Copy link
Copy Markdown
Contributor

thank you, good catch.

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.

2 participants