cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anshul1886 <...@git.apache.org>
Subject [GitHub] cloudstack pull request #1867: CLOUDSTACK-9706: Added snapshots cleanup in s...
Date Thu, 16 Mar 2017 10:46:14 GMT
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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message