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

fix:react leader elect #2167

Merged
merged 1 commit into from
Dec 20, 2022
Merged

fix:react leader elect #2167

merged 1 commit into from
Dec 20, 2022

Conversation

lut777
Copy link
Contributor

@lut777 lut777 commented Dec 14, 2022

What type of this PR

Examples of user facing changes:

  • Bug fixes

Which issue(s) this PR fixes:

Fixes #1947

cluster init:
image

delete and trigger controller exist:
image

the log of controller who lost leader:
image

@lut777 lut777 force-pushed the master branch 2 times, most recently from d8fe016 to 7da6d48 Compare December 14, 2022 12:42
@lut777 lut777 marked this pull request as ready for review December 19, 2022 02:21
@@ -20,6 +25,8 @@ import (
"github.com/kubeovn/kube-ovn/versions"
)

const ovnLeadeResource = "kube-ovn-controller"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const ovnLeadeResource = "kube-ovn-controller"
const ovnLeaderResource = "kube-ovn-controller"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

RenewDeadline: 10 * time.Second,
RetryPeriod: 2 * time.Second,
Callbacks: leaderelection.LeaderCallbacks{
OnStartedLeading: func(ctx context.Context) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use ctx to control workers

@lut777 lut777 merged commit 484fe97 into kubeovn:master Dec 20, 2022
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

Successfully merging this pull request may close these issues.

Leader election refactor
2 participants