Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Minor] Former candidate can vote twice in one term #5891

Open
heidihoward opened this issue Jan 5, 2024 · 0 comments
Open

[Minor] Former candidate can vote twice in one term #5891

heidihoward opened this issue Jan 5, 2024 · 0 comments

Comments

@heidihoward
Copy link
Member

Former candidates can vote twice in one term in CCF Raft. This is not a safe violation as it cannot lead to two leaders in a term but it is something we might want to address at some point (or we will need to update the spec accordingly)

Steps:

  1. Node A becomes a candidate in some term, say 3
  2. However, another node (node B) is elected leader of term 3
  3. Node B sends an AE message to node A in term 3. Node A will step down to a follower in term 3

In the process of stepping down, raft.h calls become_aware_of_new_term and the voted_for field is reset, allowing the node to vote again.
https://github.com/microsoft/CCF/blob/61d6c1824f80d4714d9006b5292f2cff57473d5a/src/consensus/aft/raft.h#L1017-L1012

This report is just based of code inspection, it would be useful to generate a trace of this in practice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant