Skip to content

fix csi data mover cleanup to remove orphaned VolumeSnapshotContent when DataUpload creation fails - #10289

Open
samay43 wants to merge 2 commits into
velero-io:mainfrom
samay43:fix/csi-cleanup-vsc-on-dataupload-failure
Open

fix csi data mover cleanup to remove orphaned VolumeSnapshotContent when DataUpload creation fails#10289
samay43 wants to merge 2 commits into
velero-io:mainfrom
samay43:fix/csi-cleanup-vsc-on-dataupload-failure

Conversation

@samay43

@samay43 samay43 commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

summary of change

When CSI snapshot data movement is enabled, createDataUpload can fail after the VolumeSnapshot has been created but before the CSI snapshot controller has bound it to a VolumeSnapshotContent (i.e. before Status.BoundVolumeSnapshotContentName
is populated). In that window, CleanupVolumeSnapshot skipped patching the VolumeSnapshotContent's DeletionPolicy, deleted only the VolumeSnapshot, and left a Retain-policy VolumeSnapshotContent (and its underlying provider snapshot)
orphaned.
This adds a fallback: when Status.BoundVolumeSnapshotContentName is not yet set,
CleanupVolumeSnapshot now lists VolumeSnapshotContents and matches on Spec.VolumeSnapshotRef, which is populated at content-creation time regardless of the VolumeSnapshot's status. This ensures the orphaned content still gets its
deletion policy patched to Delete. Verified: go build ./... passes cleanly, and all existing plus new tests in
pkg/util/csi and pkg/backup/actions/csi pass.

fixed issue

Fixes #10287

Please indicate you've done the following:

@samay43
samay43 requested a review from a team as a code owner August 15, 2026 08:56
@netlify

netlify Bot commented Aug 15, 2026

Copy link
Copy Markdown

👷 Deploy request for velero pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 2440406

…SnapshotContent

Signed-off-by: samay43 <samayrbhat43@gmail.com>
Signed-off-by: samay43 <samayrbhat43@gmail.com>
@samay43
samay43 force-pushed the fix/csi-cleanup-vsc-on-dataupload-failure branch from bcab942 to 2440406 Compare August 16, 2026 07:59
@codecov

codecov Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.00000% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/util/csi/volume_snapshot.go 70.00% 3 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSI data mover cleanup does not remove the snapshot content when DataUpload creation fails

1 participant