[GitHub] nathanejohnson commented on a change in pull request #3122: Add back ability to disable backup of snapshot to secondary

2019-01-16 Thread GitBox
nathanejohnson commented on a change in pull request #3122: Add back ability to 
disable backup of snapshot to secondary
URL: https://github.com/apache/cloudstack/pull/3122#discussion_r248412594
 
 

 ##
 File path: server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
 ##
 @@ -1123,12 +1123,24 @@ public SnapshotInfo takeSnapshot(VolumeInfo volume) 
throws ResourceAllocationExc
 }
 
 SnapshotInfo snapshotOnPrimary = 
snapshotStrategy.takeSnapshot(snapshot);
-if (payload.getAsyncBackup()) {
-backupSnapshotExecutor.schedule(new 
BackupSnapshotTask(snapshotOnPrimary, snapshotBackupRetries - 1, 
snapshotStrategy), 0, TimeUnit.SECONDS);
+boolean backupFlag = BackupSnapshotAfterTakingSnapshot.value() == 
null ||
 
 Review comment:
   done


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] nathanejohnson commented on a change in pull request #3122: Add back ability to disable backup of snapshot to secondary

2019-01-16 Thread GitBox
nathanejohnson commented on a change in pull request #3122: Add back ability to 
disable backup of snapshot to secondary
URL: https://github.com/apache/cloudstack/pull/3122#discussion_r248405497
 
 

 ##
 File path: server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
 ##
 @@ -1123,12 +1123,24 @@ public SnapshotInfo takeSnapshot(VolumeInfo volume) 
throws ResourceAllocationExc
 }
 
 SnapshotInfo snapshotOnPrimary = 
snapshotStrategy.takeSnapshot(snapshot);
-if (payload.getAsyncBackup()) {
-backupSnapshotExecutor.schedule(new 
BackupSnapshotTask(snapshotOnPrimary, snapshotBackupRetries - 1, 
snapshotStrategy), 0, TimeUnit.SECONDS);
+boolean backupFlag = BackupSnapshotAfterTakingSnapshot.value() == 
null ||
+BackupSnapshotAfterTakingSnapshot.value();
+
+if (backupFlag) {
+if (payload.getAsyncBackup()) {
 
 Review comment:
   This isn't my code, but I'm not entirely sure how to even test things in 
backupSnapshotExecutor.  That is inited by the config() method, and that's not 
called from the existing unit tests.  Any thoughts?


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] nathanejohnson commented on a change in pull request #3122: Add back ability to disable backup of snapshot to secondary

2019-01-15 Thread GitBox
nathanejohnson commented on a change in pull request #3122: Add back ability to 
disable backup of snapshot to secondary
URL: https://github.com/apache/cloudstack/pull/3122#discussion_r248054925
 
 

 ##
 File path: 
engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
 ##
 @@ -149,6 +149,17 @@ public long getPhysicalSize() {
 return physicalSize;
 }
 
+@Override
+public boolean markBackedUp() {
 
 Review comment:
   Mainly I just couldn't throw a NoTransitionException because it would create 
a circular dependency.  CloudRuntimeException would work though, since as you 
say that's ultimately what ends up happening in the one place this gets called 
(for now).  I have no problem making this change.


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:
us...@infra.apache.org


With regards,
Apache Git Services