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 2C265200BD8 for ; Wed, 7 Dec 2016 10:20:38 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 2ACB6160B26; Wed, 7 Dec 2016 09:20:38 +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 9A769160AFD for ; Wed, 7 Dec 2016 10:20:37 +0100 (CET) Received: (qmail 51784 invoked by uid 500); 7 Dec 2016 09:20:36 -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 51751 invoked by uid 99); 7 Dec 2016 09:20:36 -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; Wed, 07 Dec 2016 09:20:36 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5B600E0159; Wed, 7 Dec 2016 09:20:36 +0000 (UTC) From: koushik-das To: dev@cloudstack.apache.org Reply-To: dev@cloudstack.apache.org References: In-Reply-To: Subject: [GitHub] cloudstack pull request #1722: CLOUDSTACK-9558 Cleanup the snapshots on the ... Content-Type: text/plain Message-Id: <20161207092036.5B600E0159@git1-us-west.apache.org> Date: Wed, 7 Dec 2016 09:20:36 +0000 (UTC) archived-at: Wed, 07 Dec 2016 09:20:38 -0000 Github user koushik-das commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1722#discussion_r91252165 --- Diff: engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/XenserverSnapshotStrategy.java --- @@ -260,11 +260,15 @@ public boolean deleteSnapshot(Long snapshotId) { boolean result = deleteSnapshotChain(snapshotOnImage); obj.processEvent(Snapshot.Event.OperationSucceeded); if (result) { - //snapshot is deleted on backup storage, need to delete it on primary storage - SnapshotDataStoreVO snapshotOnPrimary = snapshotStoreDao.findBySnapshot(snapshotId, DataStoreRole.Primary); - if (snapshotOnPrimary != null) { - snapshotOnPrimary.setState(State.Destroyed); - snapshotStoreDao.update(snapshotOnPrimary.getId(), snapshotOnPrimary); + SnapshotInfo snapshotOnPrimary = snapshotDataFactory.getSnapshot(snapshotId, DataStoreRole.Primary); + if(snapshotSvr.deleteSnapshot(snapshotOnPrimary)) { --- End diff -- What happens if deleteSnapshot fails? Will it be retried again? If not should the DB be always cleaned up whether snapshot removal from primary is successful or not? --- 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. ---