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

In backup sync flow put snapshotHandle as source in CSI VSContent #7924

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

anshulahuja98
Copy link
Collaborator

@anshulahuja98 anshulahuja98 commented Jun 25, 2024

Thank you for contributing to Velero!

Please add a summary of your change

Does your change fix a particular issue?

Fixes #(issue)
https://kubernetes.io/docs/concepts/storage/volume-snapshots/
image

Context:
We have few customers which have used same storage bucket across clusters, as a result of that their VSContents are syncing across clusters, After the sync the other cluster does not have permission on the snapshot of original cluster, it starts to rePUT the snapshot.
This leads to significant load on the CSI driver.

Please indicate you've done the following:

  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Created a changelog file or added /kind changelog-not-required as a comment on this pull request.
  • Updated the corresponding documentation in site/content/docs/main.

Signed-off-by: Anshul Ahuja <anshulahuja@microsoft.com>
Copy link

codecov bot commented Jun 25, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 58.77%. Comparing base (b0dc189) to head (d1d331f).
Report is 2 commits behind head on main.

Files Patch % Lines
pkg/controller/backup_sync_controller.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7924      +/-   ##
==========================================
- Coverage   58.79%   58.77%   -0.03%     
==========================================
  Files         345      345              
  Lines       28766    28768       +2     
==========================================
- Hits        16914    16908       -6     
- Misses      10423    10430       +7     
- Partials     1429     1430       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

// For creating static VSContent, we should put snapshothandle in source rather than volume handle.
// Because if VSContent syncs to a different cluster, having volumeHandle will force rePUTs on the snapshot
snapCont.Spec.Source.SnapshotHandle = snapCont.Status.SnapshotHandle
snapCont.Spec.Source.VolumeHandle = nil
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will the SnapshotHandle value be unique globally ? Or does it depend on:

  • whether the storage across clusters is shared ?
  • the csi driver of the storage provider ?

Copy link
Contributor

Choose a reason for hiding this comment

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

snapshotHandle in my experience is the unique identifier at the cloud provider level.

As long as it's the same cloud provider, same provisioner, then same snapshothandle = same unique content globally.

Copy link
Contributor

Choose a reason for hiding this comment

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

snapshotHandle for aws provisioner would be the same value as SnapshotId of an ec2 EBS snapshot
"SnapshotId": "snap-066877671789bd71b" which for the same account credentials should be unique globally regardless of cluster.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My understanding is also that same that it will mostly be unique across
Using a GUID in any naming ensures that.

In case of Azure it's a fully qualified URL with subscription, RG and snapshot name.

But again any GUID should ensure uniqueness.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@shubham-pampattiwar any other thoughts?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If possible, Could you provide a link to the change/PR that is causing the rePUTs on the snapshot ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

tagged on slack

Copy link
Collaborator

@shubham-pampattiwar shubham-pampattiwar left a comment

Choose a reason for hiding this comment

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

added a few questions

@blackpiglet blackpiglet added the kind/changelog-not-required PR does not require a user changelog. Often for docs, website, or build changes label Jul 1, 2024
@shubham-pampattiwar shubham-pampattiwar merged commit 6a7f146 into vmware-tanzu:main Jul 1, 2024
66 of 69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/changelog-not-required PR does not require a user changelog. Often for docs, website, or build changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants