-
Notifications
You must be signed in to change notification settings - Fork 71
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
Fix vsc backup plugin progress method to not fail on temporary errors #226
base: main
Are you sure you want to change the base?
Fix vsc backup plugin progress method to not fail on temporary errors #226
Conversation
Signed-off-by: Shubham Pampattiwar <[email protected]>
0743c4c
to
f3f6635
Compare
} | ||
p.Log.Warnf("VolumeSnapshotContent has a temporary error %s. SnapshotContent controller will retry later.", errorMessage) |
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.
p.Log.Warnf("VolumeSnapshotContent has a temporary error %s. SnapshotContent controller will retry later.", errorMessage) | |
p.Log.Warnf("VolumeSnapshotContent has a temporary error: %s. SnapshotContent controller will retry later.", errorMessage) |
@@ -153,10 +153,11 @@ func (p *VolumeSnapshotContentBackupItemAction) Progress(operationID string, bac | |||
if boolptr.IsSetToTrue(vsc.Status.ReadyToUse) { | |||
progress.Completed = true | |||
} else if vsc.Status.Error != nil { | |||
progress.Completed = true | |||
errorMessage := "" |
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.
If we don't mark the progress.Completed
as true
when there is an error in the VSC and VS status, one possible side-effect is that if the error cannot be resolved by retrying, the action will not be completed until the timeout. The default async operation timeout is 4 hours.
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.
Can we add a mechanism to count down the failure limitation?
For example, we can set a max try time for the VSC on error, and put that information in the VSC annotation, then update the error tried number accordingly. Until the limitation is hit, fail the action.
The default async operation sync frequency is 10s. We can introduce a new parameter alongside --item-operation-sync-frequency
to set the retry limitation.
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.
I am not sure how to track for number of errors, since last error might stay same and not be updated.
Might be better to somehow enforce 10min limit and then mark it as failed.
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.
Thanks. A timer is better. Propose the name as item-operation-error-timeout
.
The timer should be compared with the VolumeSnapshotContent.Status.Error.Time.
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.
@blackpiglet @anshulahuja98 the new parameter --item-operation-error-timeout
sounds good, will work on a PR for velero controller and then update this PR accordingly.
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.
this parameter however might lead to more concerns
where each plugin might want to have a different time limit, whereas this is a global setting
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 is better if somehow we give this error exit control to the plugin to be smart enough to exit by it's own logic than a global setting
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.
Just realized I didn't think it through.
It's not possible to have a global timer work in all of the plugins.
item-operation-error-timeout
works globally, because it's triggered in the Velero server.
If we don't modify the BIA and RIA interface, we cannot pass the timer to the Progress method.
item-operation-error-timeout
can only work in the backup_operations_controllers.go. Looks like that is not what we want to do.
Adding a default timer in the plugin code is the simplest way, but we cannot modify the timer.
Another possible way is adding the Init method just like the ObjectStore and the VolumeSnapshotter plugins.
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.
@blackpiglet @anshulahuja98 If we add item-operation-error-timeout
to backup spec then we can use it in BIA progress method, right ?
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.
@shubham-pampattiwar
That should work.
@@ -153,10 +153,11 @@ func (p *VolumeSnapshotContentBackupItemAction) Progress(operationID string, bac | |||
if boolptr.IsSetToTrue(vsc.Status.ReadyToUse) { | |||
progress.Completed = true | |||
} else if vsc.Status.Error != nil { | |||
progress.Completed = true | |||
errorMessage := "" |
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.
I am not sure how to track for number of errors, since last error might stay same and not be updated.
Might be better to somehow enforce 10min limit and then mark it as failed.
I think we can use a hard-coded value for the timeout or max retry, rather than expose a parameter to user to configure. |
Fixes vmware-tanzu/velero#7356