-
Notifications
You must be signed in to change notification settings - Fork 70
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
shubham-pampattiwar
wants to merge
1
commit into
vmware-tanzu:main
Choose a base branch
from
shubham-pampattiwar:fix-vsc-progress
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3
−2
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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 := "" | ||||||
if vsc.Status.Error.Message != nil { | ||||||
progress.Err = *vsc.Status.Error.Message | ||||||
errorMessage = *vsc.Status.Error.Message | ||||||
} | ||||||
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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
|
||||||
return progress, nil | ||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
astrue
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.