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

Retry CRD updates on conflicts #2293

Merged

Conversation

joelanford
Copy link
Member

Description of the change:
Always retry CRD updates when conflicts occur.

Motivation for the change:
Conflicts are common in eventually consistent controllers. Reconciliation should be tolerant to conflicts and retry updates with a backoff in the face of conflicts without requiring a full re-reconciliation of the object.

Currently, when a CRD update fails while reconciling an install plan due to a conflict, the install plan is permanantly marked as failed, which forces the user to delete the install plan and try again.

This PR treats conflicts as transient errors and performs retries with a default backoff.

Note that if a CRD update consistently results in conflict errors, it will still eventually be marked as failed, but this should happen extremely rarely (if ever) in practice.

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /doc
  • Commit messages sensible and descriptive

@openshift-ci openshift-ci bot requested review from hasbro17 and timflannagan July 27, 2021 17:58
@timflannagan
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 28, 2021
Copy link
Member

@njhale njhale left a comment

Choose a reason for hiding this comment

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

/approve

@openshift-ci
Copy link

openshift-ci bot commented Jul 29, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: joelanford, njhale

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 29, 2021
@openshift-merge-robot openshift-merge-robot merged commit 8b80f26 into operator-framework:master Jul 29, 2021
@joelanford joelanford deleted the crd-retry-update branch July 29, 2021 19:29
@joelanford
Copy link
Member Author

/cherry-pick release-4.7

@openshift-cherrypick-robot

@joelanford: #2293 failed to apply on top of branch "release-4.7":

Applying: installplans: retry crd updates on conflicts
Using index info to reconstruct a base tree...
M	pkg/controller/operators/catalog/step.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/controller/operators/catalog/step.go
CONFLICT (content): Merge conflict in pkg/controller/operators/catalog/step.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 installplans: retry crd updates on conflicts
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-4.7

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.

joelanford added a commit to joelanford/operator-lifecycle-manager that referenced this pull request Aug 4, 2021
openshift-merge-robot pushed a commit that referenced this pull request Sep 9, 2021
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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants