nagaboinaramgopal commented on code in PR #14089:
URL: https://github.com/apache/cloudstack/pull/14089#discussion_r3983134860


##########
server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java:
##########
@@ -1721,6 +1721,12 @@ public Snapshot allocSnapshot(Long volumeId, Long 
policyId, String snapshotName,
         if (snapshotName == null)
             snapshotName = vmDisplayName + "_" + volume.getName() + "_" + 
timeString;
 
+        for (SnapshotVO existingSnapshot : 
_snapshotDao.listByStatusNotIn(volumeId, Snapshot.State.Destroyed, 
Snapshot.State.Error)) {

Review Comment:
   Thanks @sureshanaparti , done. Added 
SnapshotDao.findByVolumeIdAndNameNotInStatus, which queries for an active (not 
Destroyed or Error) snapshot with that name on the volume, and allocSnapshot 
now just checks whether it returns a record. SnapshotManagerImplTest passes



-- 
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