cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject [43/50] [abbrv] git commit: updated refs/heads/master to 4c5f792
Date Wed, 05 Nov 2014 10:45:37 GMT
CLOUDSTACK-7835: Deleted volumes with null UUID and no removed timestamp in database still
appear.
Also removed CREATING -> DESTROY via DESTROYREQUESTED, which was causing the volume to
get stuck in expunging
state.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a53d39c1
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a53d39c1
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a53d39c1

Branch: refs/heads/master
Commit: a53d39c1b687df22768613d556637c34354cb96b
Parents: 9168d82
Author: Sanjay Tripathi <sanjay.tripathi@citrix.com>
Authored: Tue Nov 4 13:27:17 2014 +0530
Committer: Sanjay Tripathi <sanjay.tripathi@citrix.com>
Committed: Tue Nov 4 17:57:31 2014 +0530

----------------------------------------------------------------------
 api/src/com/cloud/storage/Volume.java            |  1 -
 .../storage/volume/VolumeServiceImpl.java        | 19 ++++++++++++++-----
 2 files changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a53d39c1/api/src/com/cloud/storage/Volume.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/Volume.java b/api/src/com/cloud/storage/Volume.java
index b67a395..91ad955 100755
--- a/api/src/com/cloud/storage/Volume.java
+++ b/api/src/com/cloud/storage/Volume.java
@@ -69,7 +69,6 @@ public interface Volume extends ControlledEntity, Identity, InternalIdentity,
Ba
             s_fsm.addTransition(Creating, Event.OperationRetry, Creating);
             s_fsm.addTransition(Creating, Event.OperationFailed, Allocated);
             s_fsm.addTransition(Creating, Event.OperationSucceeded, Ready);
-            s_fsm.addTransition(Creating, Event.DestroyRequested, Destroy);
             s_fsm.addTransition(Creating, Event.CreateRequested, Creating);
             s_fsm.addTransition(Ready, Event.ResizeRequested, Resizing);
             s_fsm.addTransition(Resizing, Event.OperationSucceeded, Ready);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a53d39c1/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
index d97ad60..1297da9 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
@@ -1021,11 +1021,20 @@ public class VolumeServiceImpl implements VolumeService {
             srcVolume.processEvent(Event.OperationSuccessed);
             destVolume.processEvent(Event.OperationSuccessed, result.getAnswer());
             _volumeDao.updateUuid(srcVolume.getId(), destVolume.getId());
-            destroyVolume(srcVolume.getId());
-            srcVolume = volFactory.getVolume(srcVolume.getId());
-            AsyncCallFuture<VolumeApiResult> destroyFuture = expungeVolumeAsync(srcVolume);
-            destroyFuture.get();
-            future.complete(res);
+            try {
+                destroyVolume(srcVolume.getId());
+                srcVolume = volFactory.getVolume(srcVolume.getId());
+                AsyncCallFuture<VolumeApiResult> destroyFuture = expungeVolumeAsync(srcVolume);
+                // If volume destroy fails, this could be because of vdi is still in use
state, so wait and retry.
+                if (destroyFuture.get().isFailed()) {
+                    Thread.sleep(5 * 1000);
+                    destroyFuture = expungeVolumeAsync(srcVolume);
+                    destroyFuture.get();
+                }
+                future.complete(res);
+            } catch (Exception e) {
+                s_logger.debug("failed to clean up volume on storage", e);
+            }
             return null;
         } catch (Exception e) {
             s_logger.debug("Failed to process copy volume callback", e);


Mime
View raw message