Skip to content

fix: add config_changing_ guard to set_priority()#651

Open
Qian-Cheng-nju wants to merge 2 commits intoeBay:masterfrom
specula-org:fix/set-priority-config-guard
Open

fix: add config_changing_ guard to set_priority()#651
Qian-Cheng-nju wants to merge 2 commits intoeBay:masterfrom
specula-org:fix/set-priority-config-guard

Conversation

@Qian-Cheng-nju
Copy link
Copy Markdown

@Qian-Cheng-nju Qian-Cheng-nju commented Mar 25, 2026

Hi, thanks for NuRaft!

I noticed a small gap in the config change guard and put together a fix.

set_priority() appends a ConfigEntry without checking config_changing_, so if called right after a leader election (before the BecomeLeader ConfigEntry is committed), it creates two uncommitted config entries in the log. This breaks the one-config-change-at-a-time invariant that handle_add_srv_req and handle_rm_srv_req both enforce.

The fix adds the same config_changing_ check that the other config-modifying paths already have.

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