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 a race condition on object recreation #1835

Merged
merged 1 commit into from
Mar 28, 2022

Conversation

tiraboschi
Copy link
Member

If the cluster admin deletes one of the
HCO managed resource, HCO will try to
recreate it but (according to the delete
instant) HCO could potentially consume
a cached in-memoery reppresentation
of the object that can include a
resourceVersion. In that case HCO
was going to fail in a loop with:
"resourceVersion should not be set on objects to be created".
Let's ensure we never try to re-create an object
with a value for resourceVersion.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=2062321

Signed-off-by: Simone Tiraboschi stirabos@redhat.com

Reviewer Checklist

Reviewers are supposed to review the PR for every aspect below one by one. To check an item means the PR is either "OK" or "Not Applicable" in terms of that item. All items are supposed to be checked before merging a PR.

  • PR Message
  • Commit Messages
  • How to test
  • Unit Tests
  • Functional Tests
  • User Documentation
  • Developer Documentation
  • Upgrade Scenario
  • Uninstallation Scenario
  • Backward Compatibility
  • Troubleshooting Friendly

Release note:

Fix a race condition on object recreation

@tiraboschi tiraboschi closed this Mar 25, 2022
@tiraboschi tiraboschi reopened this Mar 25, 2022
@kubevirt-bot kubevirt-bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/L labels Mar 25, 2022
@tiraboschi tiraboschi closed this Mar 25, 2022
@tiraboschi tiraboschi reopened this Mar 25, 2022
@tiraboschi tiraboschi closed this Mar 25, 2022
@tiraboschi tiraboschi reopened this Mar 25, 2022
@tiraboschi tiraboschi closed this Mar 25, 2022
@tiraboschi tiraboschi reopened this Mar 25, 2022
@tiraboschi tiraboschi closed this Mar 25, 2022
@tiraboschi tiraboschi reopened this Mar 25, 2022
@tiraboschi tiraboschi closed this Mar 25, 2022
@tiraboschi tiraboschi reopened this Mar 25, 2022
@tiraboschi tiraboschi closed this Mar 25, 2022
@tiraboschi tiraboschi reopened this Mar 25, 2022
@tiraboschi tiraboschi closed this Mar 25, 2022
@tiraboschi tiraboschi reopened this Mar 25, 2022
@hco-bot
Copy link
Collaborator

hco-bot commented Mar 25, 2022

hco-e2e-upgrade-index-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-aws
hco-e2e-image-index-azure, hco-e2e-image-index-gcp lanes succeeded.
/override ci/prow/hco-e2e-image-index-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-aws, ci/prow/hco-e2e-upgrade-index-aws

In response to this:

hco-e2e-upgrade-index-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-aws
hco-e2e-image-index-azure, hco-e2e-image-index-gcp lanes succeeded.
/override ci/prow/hco-e2e-image-index-aws

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.

@tiraboschi tiraboschi closed this Mar 25, 2022
@tiraboschi tiraboschi reopened this Mar 25, 2022
@tiraboschi tiraboschi closed this Mar 25, 2022
@tiraboschi tiraboschi reopened this Mar 25, 2022
@tiraboschi tiraboschi closed this Mar 25, 2022
@tiraboschi tiraboschi reopened this Mar 25, 2022
@tiraboschi tiraboschi closed this Mar 25, 2022
@tiraboschi tiraboschi reopened this Mar 25, 2022
@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 28, 2022
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nunnatsa

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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 28, 2022
@tiraboschi tiraboschi closed this Mar 28, 2022
@tiraboschi tiraboschi reopened this Mar 28, 2022
@sonarcloud
Copy link

sonarcloud bot commented Mar 28, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@tiraboschi
Copy link
Member Author

/retest

@hco-bot
Copy link
Collaborator

hco-bot commented Mar 28, 2022

hco-e2e-image-index-aws lane succeeded.
/override ci/prow/hco-e2e-image-index-gcp

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-gcp

In response to this:

hco-e2e-image-index-aws lane succeeded.
/override ci/prow/hco-e2e-image-index-gcp

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.

@tiraboschi
Copy link
Member Author

/retest

1 similar comment
@tiraboschi
Copy link
Member Author

/retest

@hco-bot
Copy link
Collaborator

hco-bot commented Mar 28, 2022

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-kv-smoke-azure

In response to this:

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

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.

@tiraboschi
Copy link
Member Author

/retest

@hco-bot
Copy link
Collaborator

hco-bot commented Mar 28, 2022

hco-e2e-image-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-image-index-sno-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-sno-aws

In response to this:

hco-e2e-image-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-image-index-sno-aws

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.

@tiraboschi
Copy link
Member Author

/cherry-pick release-1.6

@kubevirt-bot
Copy link
Contributor

@tiraboschi: once the present PR merges, I will cherry-pick it on top of release-1.6 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.6

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.

@openshift-ci
Copy link

openshift-ci bot commented Mar 28, 2022

@tiraboschi: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/hco-e2e-image-index-gcp 7ab45ca link true /test hco-e2e-image-index-gcp
ci/prow/hco-e2e-kv-smoke-azure 7ab45ca link true /test hco-e2e-kv-smoke-azure
ci/prow/hco-e2e-image-index-sno-aws 7ab45ca link false /test hco-e2e-image-index-sno-aws
ci/prow/hco-e2e-upgrade-prev-index-aws 7ab45ca link true /test hco-e2e-upgrade-prev-index-aws
ci/prow/hco-e2e-upgrade-index-sno-aws 7ab45ca link false /test hco-e2e-upgrade-index-sno-aws

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@tiraboschi
Copy link
Member Author

/override-bot

@hco-bot
Copy link
Collaborator

hco-bot commented Mar 28, 2022

hco-e2e-upgrade-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-sno-aws
hco-e2e-upgrade-prev-index-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-upgrade-index-sno-aws, ci/prow/hco-e2e-upgrade-prev-index-aws

In response to this:

hco-e2e-upgrade-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-sno-aws
hco-e2e-upgrade-prev-index-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-aws

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.

@kubevirt-bot kubevirt-bot merged commit 8bed66e into kubevirt:main Mar 28, 2022
@kubevirt-bot
Copy link
Contributor

@tiraboschi: #1835 failed to apply on top of branch "release-1.6":

Applying: Fix a race condition on object recreation
Using index info to reconstruct a base tree...
A	controllers/operands/operand.go
A	controllers/operands/operand_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/controller/operands/operand_test.go
Auto-merging pkg/controller/operands/operand.go
CONFLICT (content): Merge conflict in pkg/controller/operands/operand.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 Fix a race condition on object recreation
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-1.6

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.

tiraboschi added a commit to tiraboschi/hyperconverged-cluster-operator that referenced this pull request Mar 28, 2022
If the cluster admin deletes one of the
HCO managed resource, HCO will try to
recreate it but (according to the delete
instant) HCO could potentially consume
a cached in-memoery reppresentation
of the object that can include a
resourceVersion. In that case HCO
was going to fail in a loop with:
"resourceVersion should not be set on objects to be created".
Let's ensure we never try to re-create an object
with a value for resourceVersion.

This is a manual cherry-pick of kubevirt#1835

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=2062321

Signed-off-by: Simone Tiraboschi <stirabos@redhat.com>
kubevirt-bot pushed a commit that referenced this pull request Mar 29, 2022
If the cluster admin deletes one of the
HCO managed resource, HCO will try to
recreate it but (according to the delete
instant) HCO could potentially consume
a cached in-memoery reppresentation
of the object that can include a
resourceVersion. In that case HCO
was going to fail in a loop with:
"resourceVersion should not be set on objects to be created".
Let's ensure we never try to re-create an object
with a value for resourceVersion.

This is a manual cherry-pick of #1835

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=2062321

Signed-off-by: Simone Tiraboschi <stirabos@redhat.com>
@tiraboschi tiraboschi deleted the recreate_race branch April 1, 2022 15:58
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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants