andrijapanicsb edited a comment on issue #3969: Snapshot deletion issues URL: https://github.com/apache/cloudstack/pull/3969#issuecomment-609950065 Latest testing of the deletion stuff reports below (previously I have tested normal operations works fine - convert to this to that, revert (KVM only), etc, for all 3 hypervisors) ## snapshot.backup.to.secondary=FALSE Expected to work ONLY with KVM+Ceph (not other variants, not other hypervisors) (but the basic create/delete snap was tested with KVM+NFS to make sure nothing broken in that specific flow) create, delete snap works fine - GC kicks in, no exceptions - after GC runs, the "PRIMARY" (role_type=primary) row in snapshots_store_ref is left undeleted (with other snapshot.backup.to.secondary=TRUE testing as well) @rafaelweingartner please test with Ceph if possible ## snapshot.backup.to.secondary=TRUE - snaps can be created, operated with, deleted fine - deleted from file systems as expected (State changed to Destroyed in snapshots and snapshot_store_ref tables - "removed"date NOT set in the main "snapshots" table - GC will remove the IMAGE row (role_type=image) from the snapshot_store_ref table and set the "removed" date in the main "snapshots" table - GC will NOT remove the PRIMARY row from the snapshot_store_ref table (any of possibly many rows for the same volume (i.e. many different snapss of the same volume) - When a volume (root/data) is removed, then only first/latest (not sure) PRIMARY row in the snapshot_store_ref table- all other PRIMARY rows for a particular volume are left - i.e. DB garbage is left ### GC garbage workaround Remove rows from snapshot_store_ref table: > delete from snapshot_store_ref where snapshot_id in (select id from snapshots where status="Destroyed" and removed is NOT NULL); (removed not NULL = means that the GC has run and left the garbage behind) or the safer one (volume is removed) > delete from snapshot_store_ref where snapshot_id in (select id from snapshots where status="Destroyed" and removed is NOT NULL) and volume_id in (select id from volumes where state="Expunged" and removed is NOT NULL);
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
