Github user jburwell commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1740#discussion_r87913578 --- Diff: server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java --- @@ -1111,6 +1111,20 @@ public boolean canOperateOnVolume(Volume volume) { } @Override + public void cleanupSnapshotsByVolume(Long volumeId) { + List<SnapshotVO> volSnapShots = _snapshotDao.listByVolumeId(volumeId); + for(SnapshotVO snapshot: volSnapShots) { + SnapshotInfo info = snapshotFactory.getSnapshot(snapshot.getId(), DataStoreRole.Primary); --- End diff -- This appears to be an application side join. Please consider creating a new query to retrieve all snapshot info instances associated with `volumeId` to reduce load on the database and simplify this method.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---