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
LeaderElection leader transitions #4320
Comments
shawkins
added a commit
to shawkins/kubernetes-client
that referenced
this issue
Aug 8, 2022
… fixing transitions
11 tasks
shawkins
added a commit
to shawkins/kubernetes-client
that referenced
this issue
Aug 8, 2022
… fixing transitions
shawkins
added a commit
to shawkins/kubernetes-client
that referenced
this issue
Aug 8, 2022
… fixing transitions
The leader election record leaderTransitions field should only increment after a change of leadership. Related client-go code in leaderelection.go: // 3. We're going to try to update. The leaderElectionRecord is set to it's default
// here. Let's correct it before updating.
if le.IsLeader() {
leaderElectionRecord.AcquireTime = oldLeaderElectionRecord.AcquireTime
leaderElectionRecord.LeaderTransitions = oldLeaderElectionRecord.LeaderTransitions
} else {
leaderElectionRecord.LeaderTransitions = oldLeaderElectionRecord.LeaderTransitions + 1
} The following code needs an update (+test): Lines 169 to 174 in b860309
|
shawkins
added a commit
to shawkins/kubernetes-client
that referenced
this issue
Aug 9, 2022
shawkins
added a commit
to shawkins/kubernetes-client
that referenced
this issue
Aug 10, 2022
manusa
pushed a commit
that referenced
this issue
Aug 10, 2022
11 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
LeaderTransitions is resetting on a change of leadership, and incrementing while holding the lock. I think this should instead be to increment on a change and to leave the value alone will renewing.
The text was updated successfully, but these errors were encountered: