You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by ustcweizhou <gi...@git.apache.org> on 2017/03/06 09:19:53 UTC

[GitHub] cloudstack pull request #1726: CLOUDSTACK-9560 Root volume of deleted VM lef...

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