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

When the leader election is enabled, set true in leaderElectionReleaseOnCancel #3093

Merged

Conversation

tenzen-y
Copy link
Member

@tenzen-y tenzen-y commented Sep 18, 2024

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

When the manager is terminated, the leader role replica should voluntarily steps down from its own leader role
so that backup role can take the leader role as soon as possible.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Fix a bug that could delay the election of a new leader in the Kueue with multiple replicas env.

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 18, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tenzen-y

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 18, 2024
Copy link

netlify bot commented Sep 18, 2024

Deploy Preview for kubernetes-sigs-kueue ready!

Name Link
🔨 Latest commit d72a0a6
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/66eb5b7729aa050008a70135
😎 Deploy Preview https://deploy-preview-3093--kubernetes-sigs-kueue.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 18, 2024
@tenzen-y
Copy link
Member Author

/assign @trasc

@trasc
Copy link
Contributor

trasc commented Sep 19, 2024

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 19, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: cc9935ea750033752c1bf2f2271219fe3d0ff750

@k8s-ci-robot k8s-ci-robot merged commit 5a8d4d3 into kubernetes-sigs:main Sep 19, 2024
16 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v0.9 milestone Sep 19, 2024
@mimowo
Copy link
Contributor

mimowo commented Sep 19, 2024

When the manager is terminated, the leader role replica should voluntarily steps down from its own leader role
so that backup role can take the leader role as soon as possible.

If we didn't do that it feels like a bug more than just cleanup. Do you know how much delay it was causing? Maybe we could consider this for cherry-picking. WDYT @tenzen-y ?

@tenzen-y tenzen-y deleted the terminate-kueue-manager-assp branch September 19, 2024 12:27
@tenzen-y
Copy link
Member Author

When the manager is terminated, the leader role replica should voluntarily steps down from its own leader role
so that backup role can take the leader role as soon as possible.

If we didn't do that it feels like a bug more than just cleanup. Do you know how much delay it was causing? Maybe we could consider this for cherry-picking. WDYT @tenzen-y ?

Goog point.

I'm not sure how much exactly time the backup replica take the leader when the primary manager is terminated.
But, the default lease renew duration is 10 sec. So, it seems that missing leader situation could happen 10sec at a max.

https://github.com/kubernetes-sigs/controller-runtime/blob/62834f93955d634d84c64159e09a54897c6b7c21/pkg/manager/manager.go#L215-L217

I guess that the situation could happen when the primary manager takes a long time to graceful terminate cache and scheduler, and all Kueue internal components.

@tenzen-y
Copy link
Member Author

So, I think that cherry-picking this to release-0.8 could bring production env more stability.

@tenzen-y
Copy link
Member Author

/remove-kind-cleanup

@tenzen-y
Copy link
Member Author

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 19, 2024
@tenzen-y
Copy link
Member Author

/remove-kind cleanup

@k8s-ci-robot k8s-ci-robot removed the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Sep 19, 2024
@tenzen-y
Copy link
Member Author

/release-note-edit

Fix a bug that could delay the election of a new leader in the Kueue with multiple replicas env.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Sep 19, 2024
@tenzen-y
Copy link
Member Author

/cherry-pick release-0.8

@k8s-infra-cherrypick-robot
Copy link
Contributor

@tenzen-y: new pull request created: #3096

In response to this:

/cherry-pick release-0.8

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants