vmware-tanzu / velero

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

Delete backup does not delete Restic data #5366

Closed eemcmullan closed 1 year ago

eemcmullan commented 1 year ago

What steps did you take and what happened:

velero $ velero describe backup backuptest                                    
Name:         backuptest
Namespace:    velero
Labels:       velero.io/storage-location=default
Annotations:  velero.io/source-cluster-k8s-gitversion=v1.23.5+b0357ed
              velero.io/source-cluster-k8s-major-version=1
              velero.io/source-cluster-k8s-minor-version=23

Phase:  Completed

Errors:    0
Warnings:  0

Namespaces:
  Included:  mssql-persistent
  Excluded:  <none>

Resources:
  Included:        *
  Excluded:        <none>
  Cluster-scoped:  auto

Label selector:  <none>

Storage Location:  default

Velero-Native Snapshot PVs:  auto

TTL:  720h0m0s

Hooks:  <none>

Backup Format Version:  1.1.0

Started:    2022-09-20 12:25:55 -0400 EDT
Completed:  2022-09-20 12:26:45 -0400 EDT

Expiration:  2022-10-20 12:25:55 -0400 EDT

Total items to be backed up:  42
Items backed up:              42

Velero-Native Snapshots: <none included>

Restic Backups (specify --details for more information):
  Completed:  1
velero $ velero delete backup backuptest
Are you sure you want to continue (Y/N)? y
Request to delete backup "backuptest" submitted successfully.

velero $ velero describe backup backuptest                                  
An error occurred: backups.velero.io "backuptest" not found
velero $ aws s3 ls mybucket/velero/                             
                           PRE restic/
velero $ aws s3 ls mybucket/velero/restic/mssql-persistent/data/   
                           PRE 32/
                           PRE 37/
                           PRE 38/
                           PRE 46/
                           PRE 53/
                           PRE 6a/
                           PRE 75/
                           PRE a7/
                           PRE c2/
                           PRE e7/
                           PRE f2/

What did you expect to happen: The Restic backup data to be deleted.

Environment:

Vote on this issue!

This is an invitation to the Velero community to vote on issues, you can see the project's top voted issues listed here.
Use the "reaction smiley face" up to the right of this comment to vote.

Lyndon-Li commented 1 year ago

Restic backup data basically include two parts: the snapshot and the data content (in the data folder as you shared). The snapshot is a collection of references to the data contents.

For a Restic backup deletion process, which also implements Velero's backup deletion, it deletes the snapshot itself only and doesn't touch the data content. After the snapshot is deleted, the related data content will be orphan, and once a maintenance/prune process runs, the orphan data content will be deleted.

That is to say, it is the expected behavior that you don't see files in the data folder been deleted.

eemcmullan commented 1 year ago

Thank you for the response.

ywk253100 commented 1 year ago

I'm closing this issue as it works as expected. Feel free to reopen it if you have any further questions