weizhouapache commented on PR #14386: URL: https://github.com/apache/cloudstack/pull/14386#issuecomment-6334635831
> Great work, Wei! > > I will follow up later with some more review comments. The `csbackup-` snapshot is not removed when the last backup in the chain is deleted or when the backup offering is removed from the VM. The next backup will be anyway always full so the snapshot is not needed. And if a new backup is never taken, the space will forever be trapped in the snapshot. Thanks @abh1sar. The leaked csbackup- snapshot is fixed in bafa96bd597 (kvm: remove the backup anchor once the chain it anchors is gone). The anchors of an Instance's volumes are now removed wherever the chain ends, next to where the Instance's active checkpoint was already being cleared: - when the deleted backup is the one the active checkpoint points to (deleteBackupFileAndRow). A backup that still has live descendants is only tombstoned and leaves the anchor alone. - when the Instance is removed from its backup offering (removeVMFromBackupOffering). The NAS provider keeps the backups in that case, which is why the anchor goes without any backup being deleted. I checked it on a Ceph (RBD) test environment with `rbd snap ls` on the Instance's image, on a 4.23-based branch with these two commits cherry-picked: | Step | `csbackup-` snapshots in Ceph | | --- | --- | | before any backup | none | | after the full | 1 | | after the incremental | 1 (the previous anchor rotated out) | | delete the backup that holds the active anchor | **none**, active checkpoint cleared, the full still there | | new full, then remove the Instance from its offering | **none**, both backups still recorded | | stop, restore from a retained backup, start | Instance `Running`, still no snapshot | `test_backup_recovery_nas.py` on the same environment: 12 tests, 10 passed, 2 skipped (the stopped-Instance full fallback does not apply on RBD, and the other-zone test needs two zones), no failures. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
