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 race condition in populators so we clean up PVC' after population succeeds #2821

Merged
merged 1 commit into from
Aug 1, 2023

Conversation

alromeros
Copy link
Collaborator

@alromeros alromeros commented Jul 27, 2023

What this PR does / why we need it:

This Pull Request fixes a race condition in CDI populators so we fetch the PVC' even if the population source doesn't exist.

This new behavior allows us to correctly delete the PVC' once the population has succeeded. We assume that, if PVC' already exists, all the requirements for population have already been met, so we don't need to check them all again.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes # https://bugzilla.redhat.com/show_bug.cgi?id=2223361

Release note:

Bugfix: Clean up PVC' when population succeeds even if the population source doesn't exist

@kubevirt-bot kubevirt-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 27, 2023
@kubevirt-bot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Jul 27, 2023
@alromeros alromeros marked this pull request as ready for review July 27, 2023 16:43
@kubevirt-bot kubevirt-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 27, 2023
… all cases

This commit fixes a race condition in CDI populators so we attempt to get PVC' even if the population source doesn't exist.

This new behavior allows us to correctly delete the PVC' once the population has succeeded, even if the population source doesn't exist anymore.

Signed-off-by: Alvaro Romero <alromero@redhat.com>
@alromeros
Copy link
Collaborator Author

/cc @mhenriks
I can't think of any unintended consequence of returning PVC' before the other reconcileCommon checks, wdyt?

@awels
Copy link
Member

awels commented Jul 31, 2023

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 31, 2023
@mhenriks
Copy link
Member

mhenriks commented Aug 1, 2023

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mhenriks

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 Aug 1, 2023
@alromeros
Copy link
Collaborator Author

/test pull-containerized-data-importer-e2e-ceph

1 similar comment
@alromeros
Copy link
Collaborator Author

/test pull-containerized-data-importer-e2e-ceph

@awels
Copy link
Member

awels commented Aug 1, 2023

/cherrypick release-v1.57

@kubevirt-bot
Copy link
Contributor

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

In response to this:

/cherrypick release-v1.57

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 4a784c2 into kubevirt:main Aug 1, 2023
17 checks passed
@kubevirt-bot
Copy link
Contributor

@awels: #2821 failed to apply on top of branch "release-v1.57":

Applying: Fix race condition in populators so we clean PVC' after population in all cases
Using index info to reconstruct a base tree...
M	pkg/controller/populators/import-populator.go
M	pkg/controller/populators/import-populator_test.go
M	pkg/controller/populators/populator-base.go
M	tests/import_test.go
M	tests/upload_test.go
Falling back to patching base and 3-way merge...
Auto-merging tests/upload_test.go
Auto-merging tests/import_test.go
CONFLICT (content): Merge conflict in tests/import_test.go
Auto-merging pkg/controller/populators/populator-base.go
Auto-merging pkg/controller/populators/import-populator_test.go
Auto-merging pkg/controller/populators/import-populator.go
CONFLICT (content): Merge conflict in pkg/controller/populators/import-populator.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 race condition in populators so we clean PVC' after population in all cases
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:

/cherrypick release-v1.57

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.

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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants