Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4004C200C2F for ; Mon, 6 Mar 2017 10:20:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 3EA15160B76; Mon, 6 Mar 2017 09:20:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 87A4D160B73 for ; Mon, 6 Mar 2017 10:19:59 +0100 (CET) Received: (qmail 16935 invoked by uid 500); 6 Mar 2017 09:19:53 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 16923 invoked by uid 99); 6 Mar 2017 09:19:53 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Mar 2017 09:19:53 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 554ACDFDE4; Mon, 6 Mar 2017 09:19:53 +0000 (UTC) From: ustcweizhou To: dev@cloudstack.apache.org Reply-To: dev@cloudstack.apache.org References: In-Reply-To: Subject: [GitHub] cloudstack pull request #1726: CLOUDSTACK-9560 Root volume of deleted VM lef... Content-Type: text/plain Message-Id: <20170306091953.554ACDFDE4@git1-us-west.apache.org> Date: Mon, 6 Mar 2017 09:19:53 +0000 (UTC) archived-at: Mon, 06 Mar 2017 09:20:00 -0000 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 volumesOnImageStoreList = _volumeStoreDao.listVolumeDownloadUrls(); + HashSet expiredVolumeIds = new HashSet(); + HashSet activeVolumeIds = new HashSet(); 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. ---