From 8f549db518ed94b25dc17d42f3a25907aad0d66e Mon Sep 17 00:00:00 2001 From: Min Chen Date: Tue, 21 May 2013 12:00:04 -0700 Subject: [PATCH] Clean up entries in template_store_ref, volume_store_ref and snapshot_store_ref in case of operation failure. --- .../api/storage/StorageCacheManager.java | 2 +- .../datastore/db/SnapshotDataStoreVO.java | 2 - .../motion/AncientDataMotionStrategy.java | 34 +-- .../storage/image/store/TemplateObject.java | 18 +- .../storage/snapshot/SnapshotObject.java | 230 +++++++++--------- .../storage/volume/VolumeObject.java | 78 +++--- 6 files changed, 200 insertions(+), 164 deletions(-) diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StorageCacheManager.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StorageCacheManager.java index 0aa30d39b1d..917a5376526 100644 --- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StorageCacheManager.java +++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StorageCacheManager.java @@ -28,5 +28,5 @@ public interface StorageCacheManager { * @return */ DataObject getCacheObject(DataObject data, Scope scope); - DataObject deleteCacheObject(DataObject data); + boolean deleteCacheObject(DataObject data); } diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreVO.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreVO.java index 0085086e437..edb23d034f9 100644 --- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreVO.java +++ b/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreVO.java @@ -81,8 +81,6 @@ public class SnapshotDataStoreVO implements StateObject