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

Check whether the leader is valid #358

Open
hzh0425 opened this issue Dec 25, 2021 · 4 comments
Open

Check whether the leader is valid #358

hzh0425 opened this issue Dec 25, 2021 · 4 comments

Comments

@hzh0425
Copy link

hzh0425 commented Dec 25, 2021

When a network partition occurs, if there is only the leader node in a partition, it will not stepdown.
Therefore, should the logic of checking leader stepdown be added to make the leader stepdown when a network partition occurs

@Connor1996
Copy link
Collaborator

no need, the leader can't do any write/read successfully

@hzh0425
Copy link
Author

hzh0425 commented Dec 29, 2021

no need, the leader can't do any write/read successfully

However, in the 3B test, I encountered a situation:

The old leader is partitioned by the network, but it does not stop the leadership and will continue to send heartbeat to PD

Newleader will also send heartbeat to PD

This causes the cache in PD to change constantly, which slows down the performance of the system, and log replication becomes very slow. I solved this problem by adding leader lease detection

@hzh0425
Copy link
Author

hzh0425 commented Jan 2, 2022

@Connor1996
Copy link
Collaborator

Yes, it's a problem. In the implementation of tikv's raft-rs, it avoids by leader checking quorum and stepping down if the quorum is not active. But no need to consider it in tinykv for simplicity.

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

2 participants