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

Track status of volumesnapshots to update backup via backup_operations_controller #7172

Closed

Conversation

kaovilai
Copy link
Member

@kaovilai kaovilai commented Dec 2, 2023

Signed-off-by: Tiger Kaovilai tkaovila@redhat.com

Thank you for contributing to Velero!

Please add a summary of your change

Does your change fix a particular issue?

Fixes #(issue)

Please indicate you've done the following:

  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Created a changelog file or added /kind changelog-not-required as a comment on this pull request.
  • Updated the corresponding documentation in site/content/docs/main.

…_controller

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
@kaovilai kaovilai changed the title Track names of ns/volumesnapshots to get status via backup_operations_controller Track status of volumesnapshots to update backup via backup_operations_controller Dec 2, 2023
Copy link

codecov bot commented Dec 2, 2023

Codecov Report

Attention: 20 lines in your changes are missing coverage. Please review.

Comparison is base (a318e1d) 61.94% compared to head (3478acb) 61.90%.

Files Patch % Lines
pkg/backup/snapshots.go 0.00% 20 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7172      +/-   ##
==========================================
- Coverage   61.94%   61.90%   -0.05%     
==========================================
  Files         259      259              
  Lines       27903    27922      +19     
==========================================
- Hits        17285    17284       -1     
- Misses       9410     9430      +20     
  Partials     1208     1208              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sseago
Copy link
Collaborator

sseago commented Dec 4, 2023

@kaovilai Note that if you're tracking this during the backup operations controller, you'll need to do the first pass in the backup controller. The first pass of calling the Progress method on all async operations happens at the end of the InProgress processing in the backup controller immediately following completion of item backup. If everything is done at this point (which may happen if there aren't many volumes, volumes are small-ish, and there are a lot of non-PVC items backed up after pods/pvcs), then the WaitingForPluginOperations phase is skipped entirely, and the backup moves straight to Finializing. In this case, the bacup operations controller won't reconcile the backup at all.

@kaovilai
Copy link
Member Author

kaovilai commented Dec 5, 2023

WaitingForPluginOperations phase is skipped entirely

CSI plugin is now biav2, so it should be in one of the backup item operations.

If we can get it's operationID, and that OperationProgress is completed without errors then we can consider that CSI snapshot completed successfully.

@sseago
Copy link
Collaborator

sseago commented Dec 6, 2023

@kaovilai "CSI plugin is now biav2, so it should be in one of the backup item operations."

Yes -- I'm just saying that whatever you do in backup_operations_controller must also be done in backup_controller after the first Progress check, since if all of the backup operations (including CSI plugin operations) have already completed when the transition from InProgress happens, then the backup goes straight to finalizing, since there's no need to poll the backup for progress later, since we're already done.

In other words, Velero calls Progress repeatedly for each incomplete operation until they're all either completed or failed, but the first polling happens from the backup controller before leaving the InProgress phase, right before we upload the backup tarball the first time. This way if the operations are all quick, we don't need to wait/poll, so the WaitingForPluginOperations phase is skipped completely.

@kaovilai
Copy link
Member Author

kaovilai commented Dec 6, 2023

Thanks for the note

@kaovilai
Copy link
Member Author

kaovilai commented Dec 6, 2023

Superceded by
#7184

@kaovilai kaovilai closed this Dec 6, 2023
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.

2 participants