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 endpoint reconciler failing to delete masterlease #114122

Merged

Conversation

aojea
Copy link
Member

@aojea aojea commented Nov 24, 2022

Fixes: #114049

This is @wojtek-t 's + a regression test #114109

Fix a regression with endpoint reconciler not being able to delete the apiserver lease on shutdown

This was introduced in #113686 so will need to be cherrypicked back to all releases that PR was cherrypicked.

/king bug
/kind regression
/sig api-machinery
/priority critical-urgent

/assign @wojtek-t @liggitt @lavalamp @tallclair

@k8s-ci-robot k8s-ci-robot added kind/regression Categorizes issue or PR as related to a regression from a prior release. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 24, 2022
@k8s-ci-robot
Copy link
Contributor

Please note that we're already in Test Freeze for the release-1.26 branch. This means every merged PR will be automatically fast-forwarded via the periodic ci-fast-forward job to the release branch of the upcoming v1.26.0 release.

Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Thu Nov 24 21:33:01 UTC 2022.

@k8s-ci-robot k8s-ci-robot added priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 24, 2022
@aojea
Copy link
Member Author

aojea commented Nov 24, 2022

stress ./reconcilers.test -test.run TestLease.*
5s: 132 runs so far, 0 failures
10s: 286 runs so far, 0 failures
15s: 441 runs so far, 0 failures
20s: 601 runs so far, 0 failures
25s: 755 runs so far, 0 failures
30s: 909 runs so far, 0 failures
35s: 1061 runs so far, 0 failures

@aojea
Copy link
Member Author

aojea commented Nov 24, 2022

/assign @wojtek-t @liggitt @lavalamp @tallclair

@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 do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 24, 2022
@aojea
Copy link
Member Author

aojea commented Nov 24, 2022

#114109 (comment)
@kubernetes/release-managers

Copy link
Member

@wojtek-t wojtek-t left a comment

Choose a reason for hiding this comment

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

This is great - just some minor comments.
Please fix the verify test failures.

pkg/controlplane/reconcilers/lease_test.go Show resolved Hide resolved
pkg/controlplane/reconcilers/lease_test.go Outdated Show resolved Hide resolved
add regression test for endpoint reconciler leases
@aojea aojea force-pushed the fix_endpoint_reconciler_11_2022 branch from ea1328c to 4ffca65 Compare November 25, 2022 08:13
@wojtek-t
Copy link
Member

Copying from @liggitt from the original PR

cc @kubernetes/release-managers for visibility. We probably want to hold rc1 for this if we're not anticipating an rc2

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aojea, wojtek-t

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 Nov 25, 2022
@xmudrii
Copy link
Member

xmudrii commented Nov 25, 2022

/milestone v1.26

@k8s-ci-robot k8s-ci-robot added this to the v1.26 milestone Nov 25, 2022
@k8s-ci-robot k8s-ci-robot merged commit 6bdda2d into kubernetes:master Nov 25, 2022
@liggitt
Copy link
Member

liggitt commented Nov 25, 2022

Thanks!

@pacoxu, will this get auto-picked to release-1.26?

For 1.22-1.25, hopefully this will cherry-pick cleanly

@dims
Copy link
Member

dims commented Nov 25, 2022

@liggitt we are auto-ff-ing things from master to release-1.26 until we do the code thaw

@liggitt
Copy link
Member

liggitt commented Nov 25, 2022

That's what I thought but I wanted to double check

k8s-ci-robot added a commit that referenced this pull request Nov 26, 2022
…2-upstream-release-1.25

Automated cherry pick of #114122: Fix endpoint reconciler failing to delete masterlease
k8s-ci-robot added a commit that referenced this pull request Nov 26, 2022
…#114122-upstream-release-1.24

Automated cherry pick of #114122: Fix endpoint reconciler failing to delete masterlease
@@ -120,7 +120,8 @@ func (s *storageLeases) UpdateLease(ip string) error {

// RemoveLease removes the lease on a master IP in storage
func (s *storageLeases) RemoveLease(ip string) error {
return s.storage.Delete(apirequest.NewDefaultContext(), s.baseKey+"/"+ip, &corev1.Endpoints{}, nil, rest.ValidateAllObjectFunc, nil)
key := path.Join(s.baseKey, ip)
Copy link
Member

Choose a reason for hiding this comment

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

Can you avoid using path.Join for this? I know it's a pain but hiding the call to path.Clean is a problem.

cc @tallclair

Copy link
Member

Choose a reason for hiding this comment

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

at head, in a followup, sure. For backports, I don't think it's worth it. baseKey is hardcoded and IP is a stringified net.IP so it can't contain weird slash/space/backstep chars

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good.

@lavalamp
Copy link
Member

Thanks for fixing this!

@fedebongio
Copy link
Contributor

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 29, 2022
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/regression Categorizes issue or PR as related to a regression from a prior release. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Endpoints doesn't reconcile in some cases from instance that is shutting down
10 participants