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

feat(cstorBackup, delete): support for snapshot deletion #57

Merged
merged 9 commits into from
Apr 7, 2020

Conversation

mynktl
Copy link
Member

@mynktl mynktl commented Apr 1, 2020

Changes:

  • This PR adds support to cleanup backup resources generated by maya-apiserver, to execute backup of CStor volumes.

Velero-plugin will execute clean-up operation in following scenarios:

  • In case of normal backup, Plugin will send delete request to api-server once the backup for the cstor volume completes

  • In case of scheduled backup, Plugin will send delete request, for second-last completed backup, to api-server.

  • If backup, normal or scheduled, is failed then plugin will send the delete request to api-server.

  • In case of scheduled backup,
    A) If backup is last generated one then Maya-Apiserver will delete the relevant CStorBackup, CStorCompletedBackups and CStor snapshot, so next new backup will be full backup
    B) If backup is not the last one then maya-apiserver will delete the relevant CStorBackup and CStor snapshot

REST API query format:
<APISERVER_ADDR>/latest/backups/<BACKUP_NAME>?volume=<VOL_NAME>&namespace=<PVC_NAMESPACE>&schedule=<SCHEDULE_NAME>

Sample query URL:
http://10.0.0.94:5656/latest/backups/emyqevym-20200401174441?volume=pvc-165d0f86-7441-11ea-9d2c-d89c67d5e4a1&namespace=app&schedule=emyqevym

Covered test cases :

  1. Test to verify clean-up of CStorBackup, CStorCompletedBackups and CStor snapshot in case of normal backup
  2. Test to verify clean-up of CStorBackup, CStorCompletedBackups and CStor snapshot in case of scheduled backup

Depends on: openebs-archive/maya#1644
Fixes: openebs/openebs#2957

@mynktl mynktl requested review from avishnu, kmova, qiell and vishnuitta April 1, 2020 18:24
pkg/cstor/cstor.go Outdated Show resolved Hide resolved
@mynktl mynktl added this to the 1.9 milestone Apr 3, 2020
Copy link
Member

@vishnuitta vishnuitta left a comment

Choose a reason for hiding this comment

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

changes are good.. one thing is: add more comments

mayank added 3 commits April 5, 2020 15:35
@kmova kmova merged commit 1cd8f21 into openebs:master Apr 7, 2020
@mynktl mynktl deleted the snap_delete branch October 16, 2020 09:54
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.

Old snapshots are still available inside pool even though the schedule is for 10 days.
4 participants