Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 86EFC11EDA for ; Wed, 27 Aug 2014 15:46:59 +0000 (UTC) Received: (qmail 39581 invoked by uid 500); 27 Aug 2014 15:46:59 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 39539 invoked by uid 500); 27 Aug 2014 15:46:59 -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 39525 invoked by uid 99); 27 Aug 2014 15:46:58 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Aug 2014 15:46:58 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id B811A1DBF78; Wed, 27 Aug 2014 15:46:58 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============7041966323572578632==" MIME-Version: 1.0 Subject: Re: Review Request 24779: [CLOUDSTACK-6254] Template disappears when download cleanup From: "David Bierce" To: "David Bierce" , "Sebastien Goasguen" , "Nitin Mehta" , "cloudstack" Date: Wed, 27 Aug 2014 15:46:58 -0000 Message-ID: <20140827154658.17463.74015@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org Auto-Submitted: auto-generated Sender: "David Bierce" X-ReviewGroup: cloudstack X-ReviewRequest-URL: https://reviews.apache.org/r/24779/ X-Sender: "David Bierce" References: <20140817030228.4095.95953@reviews.apache.org> In-Reply-To: <20140817030228.4095.95953@reviews.apache.org> Reply-To: "David Bierce" X-ReviewRequest-Repository: cloudstack-git --===============7041966323572578632== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/24779/ ----------------------------------------------------------- (Updated Aug. 27, 2014, 3:46 p.m.) Review request for cloudstack. Changes ------- Fixes the cleanup process to only remove the Template symlink, instead of delete the template from Secondary Storage. Changed to use the method Nintin suggested. This patch it tested on 4.2 using the same method as previously described. Will be testing on 4.3 today. Bugs: CLOUDSTACK-6254 https://issues.apache.org/jira/browse/CLOUDSTACK-6254 Repository: cloudstack-git Description ------- PATCH] This is a quick stab at fixing a dataloss bug. The ultimate solution is to refactor UploadManager to not use any deprecated code. It appears there is still code left over that uses the UploadVO/Dao which no long contains data about URL transfers. This method was hardcoded to always pass Upload.Type.VOLUME as part of cleanup which was causing templates to be removed entirely from secondary storage not just the symlink on secondary storage. Rather than try to refactor all of it out, this puts logic for determining if the cleanup task is for a volume or a template by doing a lookup on the URL. It is a duplication of the same logic from the calling method but is a very minimal code change until the large problem is fixed. Diffs (updated) ----- engine/api/src/org/apache/cloudstack/storage/image/datastore/ImageStoreEntity.java 7ebfd0d engine/storage/image/src/org/apache/cloudstack/storage/image/store/ImageStoreImpl.java 7bbe324 engine/storage/src/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java 2905f08 engine/storage/src/org/apache/cloudstack/storage/image/ImageStoreDriver.java 444a6c7 plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackImageStoreDriverImpl.java 4796653 server/src/com/cloud/storage/StorageManagerImpl.java 2a79b0c Diff: https://reviews.apache.org/r/24779/diff/ Testing ------- On Cloudstack 4.2 4.3 Set cleanupurl to 30 seconds. Downloaded a template, cleanup remvoed it from database, didn't remove the template. Downloaded Volume, volume was cleaned up from secondary stoage and database. Thanks, David Bierce --===============7041966323572578632==--