vmware-tanzu / velero

Backup and migrate Kubernetes applications and their persistent volumes
https://velero.io
Apache License 2.0
8.77k stars 1.41k forks source link

Restore finalizing should not run if the async restore operation is failed/cancelled #8182

Open Lyndon-Li opened 2 months ago

Lyndon-Li commented 2 months ago

Related to #8178.

We have a finalizing operation after the async restore completes regardless of the completion status of the async restore. At present, this finalizing operation is used to patch the restored PV, there are some problems:

  1. If the async operation was not successful, the PV patching operation may never succeed since the PVC/PV may not have been successfully restored
  2. If we run the finalizing operation for failed/cancelled aysnc operation, we need to be careful that the errors/warnings generated by the async operation may be overwritten by the finalizing operation

Therefore, for the current PV patch task, it should not run for failed/cancelled async operations; and for a general purpose, we need to consider whether allow the finalizing operation to run for failed/cancelled async operations.

reasonerjt commented 2 months ago

I recall there was an issue with same problem. I'll try to find out.