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

Spurious split-vote detected when a candidate wins with exactly a quorum of votes #8698

Closed
sergepetrenko opened this issue May 24, 2023 · 0 comments · Fixed by #8699
Closed
Assignees
Labels
2.10 Target is 2.10 and all newer release/master branches bug Something isn't working raft RAFT protocol

Comments

@sergepetrenko
Copy link
Collaborator

Bug description

Tarantool version: master (3.0.0-entrypoint-259-g13159230c).

A node configured as "candidate" spuriously detects a split-vote when another candidate should win elections with exactly a quorum of votes for self.

Steps to reproduce:
--
-- Instance 1.
--

-- Step 1.
box.cfg{listen = 3301, replication = {3301, 3302}, election_mode = 'candidate'}

-- Step 3.
box.schema.user.grant('guest', 'replication')

--
-- Instance 2.
--

-- Step 2.
box.cfg{listen = 3302, replication = {3301, 3302}, election_mode = 'voter'}

-- Step 4.
box.cfg{election_mode = 'candidate'}
box.ctl.promote()

After the 4 steps you will be surprised that the instance 1 logs contain the message split vote is discovered:

2023-05-24 16:38:29.354 [20337] main/110/applier/3301 I> RAFT: message {term: 3, vote: 2, state: candidate, vclock: {1: 3}} from 2
2023-05-24 16:38:29.354 [20337] main/110/applier/3301 I> RAFT: received a newer term from 2
2023-05-24 16:38:29.354 [20337] main/110/applier/3301 I> RAFT: bump term to 3, follow
2023-05-24 16:38:29.354 [20337] main/110/applier/3301 I> RAFT: vote for 2, follow
2023-05-24 16:38:29.354 [20337] main/115/raft_worker I> RAFT: persisted state {term: 3}
2023-05-24 16:38:29.354 [20337] main/115/raft_worker I> RAFT: persisted state {term: 3, vote: 2}
2023-05-24 16:38:29.354 [20337] main/115/raft_worker I> RAFT: split vote is discovered - {1: 1, 2: 1}, new term in 0.097000 sec
@sergepetrenko sergepetrenko added bug Something isn't working raft RAFT protocol labels May 24, 2023
@sergepetrenko sergepetrenko self-assigned this May 24, 2023
sergepetrenko added a commit to sergepetrenko/tarantool that referenced this issue May 24, 2023
Due to a typo raft candidate counted a vote for another node as a vote
for self in its split-vote detector. This could lead to spurious
split-vote detection in cases when another node wins elections with a bare
minimum of votes for it (exactly a quorum of votes).

Closes tarantool#8698

NO_DOC=bugfix
sergepetrenko added a commit to sergepetrenko/tarantool that referenced this issue May 24, 2023
Due to a typo raft candidate counted a vote for another node as a vote
for self in its split-vote detector. This could lead to spurious
split-vote detection in cases when another node wins elections with a bare
minimum of votes for it (exactly a quorum of votes).

Closes tarantool#8698

NO_DOC=bugfix
@sergepetrenko sergepetrenko added the 2.10 Target is 2.10 and all newer release/master branches label May 24, 2023
sergepetrenko added a commit to sergepetrenko/tarantool that referenced this issue May 25, 2023
Due to a typo raft candidate counted a vote for another node as a vote
for self in its split-vote detector. This could lead to spurious
split-vote detection in cases when another node wins elections with a bare
minimum of votes for it (exactly a quorum of votes).

Closes tarantool#8698

NO_DOC=bugfix
sergepetrenko added a commit to sergepetrenko/tarantool that referenced this issue May 26, 2023
Due to a typo raft candidate counted a vote for another node as a vote
for self in its split-vote detector. This could lead to spurious
split-vote detection in cases when another node wins elections with a bare
minimum of votes for it (exactly a quorum of votes).

Closes tarantool#8698

NO_DOC=bugfix
sergepetrenko added a commit to sergepetrenko/tarantool that referenced this issue May 29, 2023
Due to a typo raft candidate counted a vote for another node as a vote
for self in its split-vote detector. This could lead to spurious
split-vote detection in cases when another node wins elections with a bare
minimum of votes for it (exactly a quorum of votes).

Closes tarantool#8698

NO_DOC=bugfix
sergepetrenko added a commit that referenced this issue May 29, 2023
Due to a typo raft candidate counted a vote for another node as a vote
for self in its split-vote detector. This could lead to spurious
split-vote detection in cases when another node wins elections with a bare
minimum of votes for it (exactly a quorum of votes).

Closes #8698

NO_DOC=bugfix
sergepetrenko added a commit that referenced this issue May 29, 2023
Due to a typo raft candidate counted a vote for another node as a vote
for self in its split-vote detector. This could lead to spurious
split-vote detection in cases when another node wins elections with a bare
minimum of votes for it (exactly a quorum of votes).

Closes #8698

NO_DOC=bugfix

(cherry picked from commit 2afde5b)
sergepetrenko added a commit that referenced this issue May 29, 2023
Due to a typo raft candidate counted a vote for another node as a vote
for self in its split-vote detector. This could lead to spurious
split-vote detection in cases when another node wins elections with a bare
minimum of votes for it (exactly a quorum of votes).

Closes #8698

NO_DOC=bugfix

(cherry picked from commit 2afde5b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.10 Target is 2.10 and all newer release/master branches bug Something isn't working raft RAFT protocol
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant