cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jburwell <...@git.apache.org>
Subject [GitHub] cloudstack pull request #1740: CLOUDSTACK-9572 Snapshot on primary storage n...
Date Mon, 14 Nov 2016 23:03:29 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message