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

[BUG] slave vote for twice in 2*timeout will won election #8752

Open
flywukong opened this issue Apr 7, 2021 · 0 comments
Open

[BUG] slave vote for twice in 2*timeout will won election #8752

flywukong opened this issue Apr 7, 2021 · 0 comments

Comments

@flywukong
Copy link

flywukong commented Apr 7, 2021

Describe the bug
suppose we have a slave change the role frequently, like slave->master->slave->master
In principle, if a slave node is elected as a master, it cannot succeed in the second election within twice the time, but in our test, if it becomes a slave and initiates another election, then it can succeed in the election , without asking for votes and self-increasing epoch。

To reproduce
suppose cluster timeout is 15s; the node1 of port 51002 is master , the node2 of port 51003 is slave

redis-cli -p 51003 cluster failover
sleep 14s;
redis-cli -p 51002 cluster failover
sleep 14s;
redis-cli -p 51003 cluster failover
sleep 14s;

then node1 has initiated two elections round in 2*timeout, and both round it has wonned election, but can not change to master , it will fullsync again as a slave role , the egative impact is that the slave will fullsync again

Expected behavior
if node has initiated two elections round in 2*timeout ,if it win in first time, it should not win election in second time

Additional information
LOG:
4018:S 07 Apr 2021 17:08:15.364 # Manual failover user request accepted.
4018:S 07 Apr 2021 17:08:15.364 # Received replication offset for paused master manual failover: 112
4018:S 07 Apr 2021 17:08:15.364 # All master replication stream processed, manual failover can start.
4018:S 07 Apr 2021 17:08:15.364 # Failover election won: I'm the new master.

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

No branches or pull requests

1 participant