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

Pending conf change is not handled correctly during campaign #12133

Closed
BusyJay opened this issue Jul 14, 2020 · 0 comments · Fixed by #12134
Closed

Pending conf change is not handled correctly during campaign #12133

BusyJay opened this issue Jul 14, 2020 · 0 comments · Fixed by #12134

Comments

@BusyJay
Copy link
Contributor

BusyJay commented Jul 14, 2020

After joint consensus is implemented, we add a new conf change type ConfChangeV2. But when counting pending conf change, only the old one is counted:

etcd/raft/raft.go

Lines 1675 to 1683 in 4c6881f

func numOfPendingConf(ents []pb.Entry) int {
n := 0
for i := range ents {
if ents[i].Type == pb.EntryConfChange {
n++
}
}
return n
}

This can lead to two leader at a term problem.

Another problem that has been fixed in raft-rs is that all type of campaign including election timeout and transferring leader should check pending conf change count. But currently etcd/raft only checks pending conf change when campaign is triggered by election timeout. This can also lead to two leader at a term problem. See also tikv/raft-rs#221.

/cc @tbg

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

Successfully merging a pull request may close this issue.

1 participant