Skip to content

Conversation

@roycaihw
Copy link
Member

@roycaihw roycaihw commented Sep 4, 2019

What type of PR is this?
/kind bug

What this PR does / why we need it:
Preconditions should retry internally on stale watch data instead of surfacing an error.

Which issue(s) this PR fixes:

Fixes #82130

Does this PR introduce a user-facing change?:

Fix a bug in apiserver that could cause a valid update request to be rejected with a precondition check failure.

/sig api-machinery
/cc @liggitt

@k8s-ci-robot k8s-ci-robot requested a review from liggitt September 4, 2019 00:35
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/apiserver labels Sep 4, 2019
@liggitt
Copy link
Member

liggitt commented Sep 4, 2019

Thanks, test looks great as well. Once this merges, please open backports to release branches as well.

/lgtm
/approve

/milestone v1.16
/priority critical-urgent

This addresses an issue that can affect all resources and cause spurious failures of API requests using preconditions under load, and is suitable for backporting to release branches.

@k8s-ci-robot k8s-ci-robot added the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Sep 4, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.16 milestone Sep 4, 2019
@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Sep 4, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, roycaihw

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

The pull request process is described here

Details 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 4, 2019
@k8s-ci-robot k8s-ci-robot merged commit 26a381b into kubernetes:master Sep 4, 2019
for {
if err := preconditions.Check(key, origState.obj); err != nil {
return err
// If our data is already up to date, return the error
Copy link
Contributor

Choose a reason for hiding this comment

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

Can the new code be put in a helper func so that code is reused between this and the s.updateState case below ?

Copy link
Member

Choose a reason for hiding this comment

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

if it doesn't make it harder to follow, that's possible. I wanted to keep this very very simple for backports.

k8s-ci-robot added a commit that referenced this pull request Sep 11, 2019
…03-upstream-release-1.15

Automated cherry pick of #82303: in GuaranteedUpdate, retry on precondition check failure if we are working with cached data
k8s-ci-robot added a commit that referenced this pull request Sep 11, 2019
…03-upstream-release-1.14

Automated cherry pick of #82303: in GuaranteedUpdate, retry on precondition check failure if we are working with cached data
k8s-ci-robot added a commit that referenced this pull request Sep 11, 2019
…03-upstream-release-1.13

Automated cherry pick of #82303: in GuaranteedUpdate, retry on precondition check failure if we are working with cached data
@roycaihw
Copy link
Member Author

/area custom-resources

@liggitt liggitt added the area/deflake Issues or PRs related to deflaking kubernetes tests label Feb 14, 2020
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. area/apiserver area/custom-resources area/deflake Issues or PRs related to deflaking kubernetes tests 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. 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/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.

"Precondition failed: UID in precondition" flakes

4 participants