sureshanaparti commented on code in PR #14089:
URL: https://github.com/apache/cloudstack/pull/14089#discussion_r3976424994
##########
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:
@nagaboinaramgopal it's better to list by snapshot name for the volume and
check if record exists or not, instead of lookup through all the snapshot
records.
--
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]