sureshanaparti commented on a change in pull request #5544:
URL: https://github.com/apache/cloudstack/pull/5544#discussion_r802520934



##########
File path: 
server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java
##########
@@ -1238,15 +1239,11 @@ public SnapshotInfo takeSnapshot(VolumeInfo volume) 
throws ResourceAllocationExc
             try {
                 postCreateSnapshot(volume.getId(), snapshotId, 
payload.getSnapshotPolicyId());
 
-                DataStoreRole dataStoreRole = getDataStoreRole(snapshot, 
_snapshotStoreDao, dataStoreMgr);
+                DataStoreRole dataStoreRole = getDataStoreRole(snapshot);
 
                 SnapshotDataStoreVO snapshotStoreRef = 
_snapshotStoreDao.findBySnapshot(snapshotId, dataStoreRole);
                 if (snapshotStoreRef == null) {
-                    // The snapshot was not backed up to secondary.  Find the 
snap on primary
-                    snapshotStoreRef = 
_snapshotStoreDao.findBySnapshot(snapshotId, DataStoreRole.Primary);
-                    if (snapshotStoreRef == null) {
-                        throw new CloudRuntimeException("Could not find 
snapshot");
-                    }
+                    throw new CloudRuntimeException(String.format("Could not 
find snapshot with id [%] on [%]", snapshotId, snapshot.getLocationType()));

Review comment:
       ```suggestion
                       throw new CloudRuntimeException(String.format("Could not 
find snapshot %s [%s] on [%s]", snapshot.getName(), snapshot.getUuid(), 
snapshot.getLocationType()));
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to