Skip to content

Add leader election to tide #17448

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

Closed
wants to merge 1 commit into from

Conversation

stpabhi
Copy link
Contributor

@stpabhi stpabhi commented Apr 30, 2020

fixes #16153

Signed-off-by: Abhilash Pallerlamudi <[email protected]>
@k8s-ci-robot
Copy link
Contributor

Welcome @stpabhi!

It looks like this is your first PR to kubernetes/test-infra 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/test-infra has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 30, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @stpabhi. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 30, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: stpabhi
To complete the pull request process, please assign cjwagner
You can assign the PR to them by writing /assign @cjwagner in a comment when ready.

The full list of commands accepted by this bot can be found 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 area/config Issues or PRs related to code in /config area/prow Issues or PRs related to prow area/prow/bump Updates to the k8s prow cluster area/prow/tide Issues or PRs related to prow's tide component sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Apr 30, 2020
@stpabhi stpabhi closed this Apr 30, 2020
@alvaroaleman
Copy link
Member

@stpabhi Did you mean to close the PR?

@stpabhi
Copy link
Contributor Author

stpabhi commented Apr 30, 2020

@alvaroaleman yes. My bad that I didn’t read the comment that says mgr is not used to control the lifecycle. I believe whatever changes I requested might be no-op. Also, is there any reason for doing that? I haven’t looked at the code in detail yet. Any pointers?

@alvaroaleman
Copy link
Member

So the reason why we don't use the Manager for the binaries lifecycle is that it doesn't support graceful termination (xref kubernetes-sigs/controller-runtime#764). This is why we currently have the interrupts package even though it solves a problem that is not specific to this project in any way.

Now that I think about it though, we could probably:

  • Continue to use interrupt to manage the binaries lifecycle
  • Build a wrapper for the tide controllers that implements manager.Runnable (This is needed so the Manager can control their lifecycle)
  • Have that wrapper finish an active sync but not start a new one once its stop channel is closed
  • Somehow tell interrupts that it has to wait (maybe we can add the controllers to both the manager and interrupts?)

Strictly speaking that means that there is a short period in which two tide instances could do work since we basically ignore the lost leader lease during shutdown and finish our current work anyways, but that is certainly better than no leader election at all.

WDYT?

@stpabhi
Copy link
Contributor Author

stpabhi commented Apr 30, 2020

Thanks for the input. I will take a look at the references and interrupts pkg to understand it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config Issues or PRs related to code in /config area/prow/bump Updates to the k8s prow cluster area/prow/tide Issues or PRs related to prow's tide component area/prow Issues or PRs related to prow cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tide: Add leader election
3 participants