-
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
Update Backup.Status.CSIVolumeSnapshotsCompleted during finalize #7046
Update Backup.Status.CSIVolumeSnapshotsCompleted during finalize #7046
Conversation
f570cf7
to
a249fd6
Compare
/kind changelog-not-required |
a249fd6
to
f8444e1
Compare
f8444e1
to
ca5c3d2
Compare
Signed-off-by: Tiger Kaovilai <[email protected]>
ca5c3d2
to
886e074
Compare
de3ea52
to
7efe36b
Compare
7efe36b
to
60a0232
Compare
60a0232
to
3209650
Compare
@kaovilai I think we'd want a changelog here since this fixes a regression introduced in 1.12 |
@@ -186,7 +191,16 @@ func (r *backupFinalizerReconciler) Reconcile(ctx context.Context, req ctrl.Requ | |||
} | |||
backup.Status.CompletionTimestamp = &metav1.Time{Time: r.clock.Now()} | |||
recordBackupMetrics(log, backup, outBackupFile, r.metrics, true) | |||
|
|||
CSISnapshotsNotReady := errors.New("CSI snapshots not ready") | |||
retry.OnError(retry.DefaultBackoff, func(err error) bool { |
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.
The question here is how long do we wanna wait for CSI to complete.
At this phase it is also probably safe to unblock a new backup, not sure if that's the case already.
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.
@kaovilai no reason to wait here. All the waiting happens during WaitingForPluginOperations phase in the backup operations controller. By the time finalizer controller reconciles a backup, we're no longer waiting for snapshot completion. They're all either completed, failed explicitly, or marked failed via timeout.
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.
We should be able to just check status a single time like we've always done in the backup controller.
3209650
to
1dbcd1f
Compare
…tus() and run in backup_finalizer_controller Signed-off-by: Tiger Kaovilai <[email protected]>
1dbcd1f
to
9311a42
Compare
Codecov Report
@@ Coverage Diff @@
## main #7046 +/- ##
==========================================
- Coverage 61.14% 61.04% -0.10%
==========================================
Files 252 256 +4
Lines 26916 27076 +160
==========================================
+ Hits 16457 16528 +71
- Misses 9295 9373 +78
- Partials 1164 1175 +11
|
/kind changelog-not-required |
@@ -186,7 +191,16 @@ func (r *backupFinalizerReconciler) Reconcile(ctx context.Context, req ctrl.Requ | |||
} | |||
backup.Status.CompletionTimestamp = &metav1.Time{Time: r.clock.Now()} | |||
recordBackupMetrics(log, backup, outBackupFile, r.metrics, true) | |||
|
|||
CSISnapshotsNotReady := errors.New("CSI snapshots not ready") | |||
retry.OnError(retry.DefaultBackoff, func(err error) bool { |
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.
@kaovilai no reason to wait here. All the waiting happens during WaitingForPluginOperations phase in the backup operations controller. By the time finalizer controller reconciles a backup, we're no longer waiting for snapshot completion. They're all either completed, failed explicitly, or marked failed via timeout.
@@ -186,7 +191,16 @@ func (r *backupFinalizerReconciler) Reconcile(ctx context.Context, req ctrl.Requ | |||
} | |||
backup.Status.CompletionTimestamp = &metav1.Time{Time: r.clock.Now()} | |||
recordBackupMetrics(log, backup, outBackupFile, r.metrics, true) | |||
|
|||
CSISnapshotsNotReady := errors.New("CSI snapshots not ready") | |||
retry.OnError(retry.DefaultBackoff, func(err error) bool { |
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.
We should be able to just check status a single time like we've always done in the backup controller.
pkg/backup/snapshots.go
Outdated
backup.Status.CSIVolumeSnapshotsAttempted = len(volumeSnapshots) | ||
for _, vs := range volumeSnapshots { | ||
if vs.Status != nil && boolptr.IsSetToTrue(vs.Status.ReadyToUse) { | ||
backup.Status.CSIVolumeSnapshotsCompleted++ |
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.
Since this is now run both during initial processing and finalizing, instead of incrementing the field directly, we should increment a local var and set the Spec
field to this value at the end of the loop. Otherwise we'll end up double counting things.
@kaovilai I removed the changelog-not-required label. |
https://github.com/vmware-tanzu/velero/pull/7046/files#r1380708644 Signed-off-by: Tiger Kaovilai <[email protected]>
Signed-off-by: Tiger Kaovilai <[email protected]>
Signed-off-by: Tiger Kaovilai <[email protected]>
Signed-off-by: Tiger Kaovilai <[email protected]>
Signed-off-by: Tiger Kaovilai <[email protected]>
Signed-off-by: Tiger Kaovilai <[email protected]>
Signed-off-by: Tiger Kaovilai [email protected]
Thank you for contributing to Velero!
Please add a summary of your change
Does your change fix a particular issue?
Fixes #7047
Please indicate you've done the following:
/kind changelog-not-required
as a comment on this pull request.site/content/docs/main
.