-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add design to introduce restore volume info #7610
Add design to introduce restore volume info #7610
Conversation
e0525c7
to
ca0d17c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7610 +/- ##
==========================================
+ Coverage 61.68% 61.86% +0.18%
==========================================
Files 263 266 +3
Lines 28826 29456 +630
==========================================
+ Hits 17781 18224 +443
- Misses 9787 9941 +154
- Partials 1258 1291 +33 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
ca0d17c
to
ab5ee7b
Compare
// RestoreVolumeInfoTracker is used to track the volume information during restore. | ||
// It is used to generate the RestoreVolumeInfo array. | ||
type RestoreVolumeInfoTracker struct { | ||
*sync.Mutex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain more on why the mutex is needed here?
Didn't find where it is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's introduced to make tracker thread-safe, considering velero may improve parallelism to handle multiple resources in one restore in future.
An example of usage:
func (t *RestoreVolumeInfoTracker) TrackNativeSnapshot(pvName string, snapshotHandle, volumeType, volumeAZ string, iops int64) {
t.Lock()
defer t.Unlock()
t.pvNativeSnapshotMap[pvName] = NativeSnapshotInfo{
SnapshotHandle: snapshotHandle,
VolumeType: volumeType,
VolumeAZ: volumeAZ,
IOPS: strconv.FormatInt(iops, 10),
}
}
/kind changelog-not-required
as a comment on this pull request.site/content/docs/main
.