Github user syed commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1600#discussion_r77259257
  
    --- Diff: 
engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/StorageSystemSnapshotStrategy.java
 ---
    @@ -212,20 +251,47 @@ public SnapshotInfo takeSnapshot(SnapshotInfo 
snapshotInfo) {
                     performSnapshotAndCopyOnHostSide(volumeInfo, snapshotInfo);
                 }
     
    -            markAsBackedUp((SnapshotObject)result.getSnashot());
    +            snapshotOnPrimary = result.getSnapshot();
    +            backedUpSnapshot = backupSnapshot(snapshotOnPrimary);
    +
    +            updateLocationTypeInDb(backedUpSnapshot);
    +
             }
             finally {
                 if (result != null && result.isSuccess()) {
                     volumeInfo.stateTransit(Volume.Event.OperationSucceeded);
    -            }
    -            else {
    +
    +                Preconditions.checkState(snapshotOnPrimary != null);
    --- End diff --
    
    Removed the precondition, added an if check which better handles the 
situation


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to