-
Notifications
You must be signed in to change notification settings - Fork 399
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
transfer leader may not be safe for lease read #234
Comments
/cc @tiancaiamao |
Lines 838 to 848 in f145d5a
|
When last index and term are recorded in |
how to deal with the situation that, I have an answer, leader election timeout will send empty entry leader will abort transferee only after receiving |
if messages are out of order and MsgTimeoutNow arrives after an election timeout, a new leader may be elected probably as MsgTimeoutNow will trigger election despite of the lease. So even if there is no clock drift, leader's lease can still be stale.
The problem is that when aborting transferring leader, leader just resets its internal field, which is not enough, because MsgTimeoutNow may still being transferring. So leader has to make sure the MsgTimeoutNow message becomes stale. It can either start a new election or add last index and term to MsgTimeoutNow and broadcast an empty entry. Former will make the election triggered by MsgTimeoutNow can't succeed, latter will either make the election can't succeed or MsgTimeoutNow be dropped.
/cc @siddontang
The text was updated successfully, but these errors were encountered: