[ https://issues.apache.org/jira/browse/CLOUDSTACK-9706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15927815#comment-15927815 ]
ASF GitHub Bot commented on CLOUDSTACK-9706: -------------------------------------------- Github user anshul1886 commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1867#discussion_r106386503 --- Diff: engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/XenserverSnapshotStrategy.java --- @@ -194,18 +194,22 @@ protected boolean deleteSnapshotChain(SnapshotInfo snapshot) { } } if (!deleted) { - boolean r = snapshotSvr.deleteSnapshot(snapshot); - if (r) { - // delete snapshot in cache if there is - List<SnapshotInfo> cacheSnaps = snapshotDataFactory.listSnapshotOnCache(snapshot.getId()); - for (SnapshotInfo cacheSnap : cacheSnaps) { - s_logger.debug("Delete snapshot " + snapshot.getId() + " from image cache store: " + cacheSnap.getDataStore().getName()); - cacheSnap.delete(); + try { + boolean r = snapshotSvr.deleteSnapshot(snapshot); + if (r) { + // delete snapshot in cache if there is + List<SnapshotInfo> cacheSnaps = snapshotDataFactory.listSnapshotOnCache(snapshot.getId()); + for (SnapshotInfo cacheSnap : cacheSnaps) { + s_logger.debug("Delete snapshot " + snapshot.getId() + " from image cache store: " + cacheSnap.getDataStore().getName()); + cacheSnap.delete(); + } } - } - if (!resultIsSet) { - result = r; - resultIsSet = true; + if (!resultIsSet) { + result = r; + resultIsSet = true; + } + } catch (Exception e){ --- End diff -- @koushik-das Its a catch all as we will retry to delete snapshot again in next attempt if it fails to delete so just logging in and carry on. Also it is introduced to make sure that all snapshots gets chance to delete. > Retry deleting snapshot if deleteSnapshot command failed > --------------------------------------------------------- > > Key: CLOUDSTACK-9706 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9706 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Reporter: Anshul Gangwar > Assignee: Anshul Gangwar > > Currently when we delete snapshot then we mark it to be in destroyed state > first and then we go to delete it on storage if it can be deleted. If the > deletion of snapshot fails then we never retry to delete it which fills up > storage. -- This message was sent by Atlassian JIRA (v6.3.15#6346)