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

more targeted cleanup of target/scratch pvcs #2676

Merged
merged 2 commits into from
Apr 7, 2023

Conversation

mhenriks
Copy link
Member

What this PR does / why we need it:

Rather than cleaning up everything on target/scratch PVCs, only delete what we may have created

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 #2635

Special notes for your reviewer:

Release note:

More targeted cleanup of target/scratch pvcs (only delete what we may have created)

@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 Mar 30, 2023
@kubevirt-bot kubevirt-bot requested review from awels and maya-r March 30, 2023 00:54
@mhenriks
Copy link
Member Author

/hold

@kubevirt-bot kubevirt-bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/L labels Mar 30, 2023
Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
@alromeros
Copy link
Collaborator

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

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
@mhenriks
Copy link
Member Author

/unhold

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 31, 2023
@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 4, 2023
@mhenriks
Copy link
Member Author

mhenriks commented Apr 7, 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 Apr 7, 2023
@mhenriks
Copy link
Member Author

mhenriks commented Apr 7, 2023

/cherrypick release-v1.54

@kubevirt-bot
Copy link
Contributor

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

In response to this:

/cherrypick release-v1.54

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 b898f03 into kubevirt:main Apr 7, 2023
@kubevirt-bot
Copy link
Contributor

@mhenriks: #2676 failed to apply on top of branch "release-v1.54":

Applying: more targeted cleanup of target/scratch pvcs
Using index info to reconstruct a base tree...
M	pkg/importer/data-processor.go
M	pkg/importer/data-processor_test.go
A	pkg/importer/gcs-datasource.go
M	pkg/importer/http-datasource.go
M	pkg/importer/imageio-datasource.go
M	pkg/importer/registry-datasource.go
M	pkg/importer/util.go
M	pkg/importer/util_test.go
M	pkg/importer/vddk-datasource_amd64.go
M	pkg/importer/vddk-datasource_test.go
M	pkg/uploadserver/uploadserver.go
M	pkg/util/util.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/util/util.go
Auto-merging pkg/uploadserver/uploadserver.go
Auto-merging pkg/importer/vddk-datasource_test.go
Auto-merging pkg/importer/vddk-datasource_amd64.go
Auto-merging pkg/importer/util_test.go
Auto-merging pkg/importer/util.go
CONFLICT (content): Merge conflict in pkg/importer/util.go
Auto-merging pkg/importer/registry-datasource.go
Auto-merging pkg/importer/imageio-datasource.go
Auto-merging pkg/importer/http-datasource.go
CONFLICT (modify/delete): pkg/importer/gcs-datasource.go deleted in HEAD and modified in more targeted cleanup of target/scratch pvcs. Version more targeted cleanup of target/scratch pvcs of pkg/importer/gcs-datasource.go left in tree.
Auto-merging pkg/importer/data-processor_test.go
CONFLICT (content): Merge conflict in pkg/importer/data-processor_test.go
Auto-merging pkg/importer/data-processor.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 more targeted cleanup of target/scratch pvcs
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.54

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.

@alromeros
Copy link
Collaborator

@mhenriks shouldn't we backport this to v1.55 and v1.56 too?

@awels
Copy link
Member

awels commented Apr 3, 2024

/cherrypick release-v1.56

@kubevirt-bot
Copy link
Contributor

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

Applying: more targeted cleanup of target/scratch pvcs
Using index info to reconstruct a base tree...
A	pkg/importer/gcs-datasource.go
M	pkg/uploadserver/uploadserver.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/uploadserver/uploadserver.go
CONFLICT (modify/delete): pkg/importer/gcs-datasource.go deleted in HEAD and modified in more targeted cleanup of target/scratch pvcs. Version more targeted cleanup of target/scratch pvcs of pkg/importer/gcs-datasource.go left in tree.
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 more targeted cleanup of target/scratch pvcs
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.56

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 pushed a commit that referenced this pull request Apr 17, 2024
* more targeted cleanup of target/scratch pvcs



* fix archive import func test



---------

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
Co-authored-by: Michael Henriksen <mhenriks@redhat.com>
kubevirt-bot pushed a commit that referenced this pull request Apr 19, 2024
* more targeted cleanup of target/scratch pvcs



* fix archive import func test



---------

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
Co-authored-by: Michael Henriksen <mhenriks@redhat.com>
@alromeros
Copy link
Collaborator

@mhenriks @awels After a couple of days investigating I’ve found that at least two of these test failures are related to this PR. The issue occurs when importing a fully allocated block PVC (e.g., the image’s actual size is 512Mi, and the PVC is also 512Mi). In such cases, we create a scratch PVC with additional overhead (542Mi).

However, using rook-ceph, there's always a lost+found directory in the scratch space that reduces the actual usable space to "capacity - overhead - lost+found size" (~505Mi in my test case), causing the import to fail. This is a bug but I’m unsure if it’s acceptable to delete lost+found in cases like these. Other solution that comes to mind is adding an arbitrary overhead to the scratch PVC to account for the lost+found size.

What are your thoughts on this? This is 100% replicable when using the vm manifest endpoint in the export API.

@alromeros
Copy link
Collaborator

@mhenriks @awels After a couple of days investigating I’ve found that at least two of these test failures are related to this PR. The issue occurs when importing a fully allocated block PVC (e.g., the image’s actual size is 512Mi, and the PVC is also 512Mi). In such cases, we create a scratch PVC with additional overhead (542Mi).

However, using rook-ceph, there's always a lost+found directory in the scratch space that reduces the actual usable space to "capacity - overhead - lost+found size" (~505Mi in my test case), causing the import to fail. This is a bug but I’m unsure if it’s acceptable to delete lost+found in cases like these. Other solution that comes to mind is adding an arbitrary overhead to the scratch PVC to account for the lost+found size.

What are your thoughts on this? This is 100% replicable when using the vm manifest endpoint in the export API.

Created a Jira card to track this bug https://issues.redhat.com/browse/CNV-51575

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.

Failure cleaning up target space: unlinkat /data/.snapshot: read-only file system
4 participants