GutoVeronezi commented on pull request #5297:
URL: https://github.com/apache/cloudstack/pull/5297#issuecomment-919366170


   > @GutoVeronezi, because this feature supports bypassing secondary storage 
with the option `snapshot.backup.to.secondary=false`, a problem appears when 
you delete a volume, and there are more than one snapshots created from it only 
on the primary storage. One snapshot is deleted in the DB, but it remains on 
the primary storage:
   > 
   > > mysql> select store_role, snapshot_id,  install_path from 
snapshot_store_ref where volume_id=307;
   > > 
+------------+-------------+------------------------------------------------------------------------------------------+
   > > | store_role | snapshot_id | install_path                                
                                             |
   > > 
+------------+-------------+------------------------------------------------------------------------------------------+
   > > | Primary    |          40 | 
/mnt/c9b09777-7340-3752-8a96-f3835f9f5c53/snapshots/d537d452-06c2-484d-a19e-851e47cb2857
 |
   > > | Primary    |          41 | 
/mnt/c9b09777-7340-3752-8a96-f3835f9f5c53/snapshots/0335db51-0a6d-472c-b587-fbfccfe21ee1
 |
   > > | Primary    |          42 | 
/mnt/c9b09777-7340-3752-8a96-f3835f9f5c53/snapshots/3c252bf7-f3a2-4d86-906d-9fc4d78ea517
 |
   > > 
+------------+-------------+------------------------------------------------------------------------------------------+
   > > 3 rows in set (0.00 sec)
   > > mysql> select store_role, snapshot_id,  install_path from 
snapshot_store_ref where volume_id=307;
   > > 
+------------+-------------+------------------------------------------------------------------------------------------+
   > > | store_role | snapshot_id | install_path                                
                                             |
   > > 
+------------+-------------+------------------------------------------------------------------------------------------+
   > > | Primary    |          40 | 
/mnt/c9b09777-7340-3752-8a96-f3835f9f5c53/snapshots/d537d452-06c2-484d-a19e-851e47cb2857
 |
   > > | Primary    |          42 | 
/mnt/c9b09777-7340-3752-8a96-f3835f9f5c53/snapshots/3c252bf7-f3a2-4d86-906d-9fc4d78ea517
 |
   > > 
+------------+-------------+------------------------------------------------------------------------------------------+
   > > 2 rows in set (0.00 sec)
   > 
   > > ls -latr snapshots/
   > > total 131460
   > > -rw-r--r-- 1 root root 44761088 Sep  3 12:28 
d537d452-06c2-484d-a19e-851e47cb2857
   > > -rw-r--r-- 1 root root 44826624 Sep  3 12:28 
0335db51-0a6d-472c-b587-fbfccfe21ee1
   > > drwxr-xr-x 2 root root      138 Sep  3 12:30 .
   > > -rw-r--r-- 1 root root 45023232 Sep  3 12:30 
3c252bf7-f3a2-4d86-906d-9fc4d78ea517
   > 
   > The deletion is invoked in `VolumeServiceImpl.deleteVolumeCallback()`. I 
guess the fix of this problem has to be discussed by the community. I mean 
which solution is the right one:
   > 
   > * to delete all snapshots from primary when deleting the volume
   > * to remove the code which deletes a record from the DB
   > * or another option
   
   @slavkap as we discussed offline, it is a point that community need to 
discuss (through issue #5433 and 
[ML](https://lists.apache.org/thread.html/r9438e1b5e58fee2275b0474255b86cd398666433e10d11b3cd519fac%40%3Cdev.cloudstack.apache.org%3E))
 and this PR won't be addressing it, at first.
   


-- 
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]


Reply via email to