mike-tutkowski commented on a change in pull request #2585: Add ability to 
archive snapshots on primary storage
URL: https://github.com/apache/cloudstack/pull/2585#discussion_r183893066
 
 

 ##########
 File path: 
engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
 ##########
 @@ -281,7 +282,13 @@ public SnapshotInfo backupSnapshot(SnapshotInfo snapshot) 
{
             s_logger.debug("Failed to copy snapshot", e);
             result.setResult("Failed to copy snapshot:" + e.toString());
             try {
-                snapObj.processEvent(Snapshot.Event.OperationFailed);
+                // When error archiving an already existing snapshot, emit 
OperationNotPerformed.
+                // This will ensure that the original snapshot does not get 
deleted
+                if (origState.equals(Snapshot.State.BackedUp)) {
 
 Review comment:
   Just curious @syed: Have you at least manually run a test case where the 
snapshot process failed and this logic was executed to see if, in fact, the 
original snapshot remained usable?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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

Reply via email to