cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ustcweizhou <...@git.apache.org>
Subject [GitHub] cloudstack pull request #1726: CLOUDSTACK-9560 Root volume of deleted VM lef...
Date Mon, 06 Mar 2017 09:19:53 GMT
Github user ustcweizhou commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1726#discussion_r104370668
  
    --- Diff: server/src/com/cloud/storage/StorageManagerImpl.java ---
    @@ -2263,27 +2264,43 @@ public void cleanupDownloadUrls(){
     
             // Cleanup expired volume URLs
             List<VolumeDataStoreVO> volumesOnImageStoreList = _volumeStoreDao.listVolumeDownloadUrls();
    +        HashSet<Long> expiredVolumeIds = new HashSet<Long>();
    +        HashSet<Long> activeVolumeIds = new HashSet<Long>();
             for(VolumeDataStoreVO volumeOnImageStore : volumesOnImageStoreList){
     
    +            long volumeId = volumeOnImageStore.getVolumeId();
                 try {
                     long downloadUrlCurrentAgeInSecs = DateUtil.getTimeDifference(DateUtil.now(),
volumeOnImageStore.getExtractUrlCreated());
                     if(downloadUrlCurrentAgeInSecs < _downloadUrlExpirationInterval){
 // URL hasnt expired yet
    +                    activeVolumeIds.add(volumeId);
                         continue;
                     }
    -
    -                s_logger.debug("Removing download url " + volumeOnImageStore.getExtractUrl()
+ " for volume id " + volumeOnImageStore.getVolumeId());
    +                expiredVolumeIds.add(volumeId);
    +                s_logger.debug("Removing download url " + volumeOnImageStore.getExtractUrl()
+ " for volume id " + volumeId);
     
                     // Remove it from image store
                     ImageStoreEntity secStore = (ImageStoreEntity) _dataStoreMgr.getDataStore(volumeOnImageStore.getDataStoreId(),
DataStoreRole.Image);
                     secStore.deleteExtractUrl(volumeOnImageStore.getInstallPath(), volumeOnImageStore.getExtractUrl(),
Upload.Type.VOLUME);
     
    +                _snapshotStoreDao.findByVolume(volumeId, DataStoreRole.Image);
    --- End diff --
    
    what's the proposal of line 2285 to line 2287 ?


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