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

Fix vsc backup plugin progress method to not fail on temporary errors #226

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shubham-pampattiwar
Copy link
Collaborator

@shubham-pampattiwar shubham-pampattiwar commented Jan 25, 2024

}
p.Log.Warnf("VolumeSnapshotContent has a temporary error %s. SnapshotContent controller will retry later.", errorMessage)

Choose a reason for hiding this comment

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

Suggested change
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 := ""
Copy link
Contributor

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.

Copy link
Contributor

@blackpiglet blackpiglet Jan 30, 2024

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.

Copy link
Collaborator

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.

Copy link
Contributor

@blackpiglet blackpiglet Jan 31, 2024

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator

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

Copy link
Collaborator

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

Copy link
Contributor

@blackpiglet blackpiglet Feb 1, 2024

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.

Copy link
Collaborator Author

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 ?

Copy link
Contributor

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 := ""
Copy link
Collaborator

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.

@reasonerjt
Copy link
Contributor

I think we can use a hard-coded value for the timeout or max retry, rather than expose a parameter to user to configure.
But given it's the Progress func in the plugin, we need to find a good way to track the time or retry number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backup is marked as waitingForPluginOperationsPartiallyfailed when VolumeSnapshotContent has an error
5 participants