You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2015/03/02 12:11:05 UTC

[1/2] git commit: updated refs/heads/master to ef99f01

Repository: cloudstack
Updated Branches:
  refs/heads/master 085554d81 -> ef99f01e5


CLOUDSTACK-6900: This fixes volume migration failing after that volume is downloaded.

When we download volume then we create entry in volume_store_ref table.
We mark the volume entry to ready state once download_url gets generated.
When we migrate that volume, then again one more entry is created with same volume id.
Its state is marked as allocated. Later we try to list only one dataobject in datastore
for state transition during volume migration. If the listed volume's state is allocated
then migration passes otherwise it fails.

Below fix will remove the randomness and give priority to volume entry which is made for
migration (download_url/extracturl will be null in case of migration). Giving priority to
download volume case is not needed as there will be only one entry in that case so no randomness.


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

Branch: refs/heads/master
Commit: 91e1881be82b06963903b7ee6aa15cdbcc04705f
Parents: 5028874
Author: Anshul Gangwar <an...@citrix.com>
Authored: Tue Jan 13 16:35:10 2015 +0530
Committer: Anshul Gangwar <an...@citrix.com>
Committed: Fri Jan 16 15:15:14 2015 +0530

----------------------------------------------------------------------
 .../image/db/VolumeDataStoreDaoImpl.java        | 24 +++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/91e1881b/engine/storage/src/org/apache/cloudstack/storage/image/db/VolumeDataStoreDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/db/VolumeDataStoreDaoImpl.java b/engine/storage/src/org/apache/cloudstack/storage/image/db/VolumeDataStoreDaoImpl.java
index b71eb2c..1f60680 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/image/db/VolumeDataStoreDaoImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/image/db/VolumeDataStoreDaoImpl.java
@@ -206,7 +206,29 @@ public class VolumeDataStoreDaoImpl extends GenericDaoBase<VolumeDataStoreVO, Lo
         sc.setParameters("store_id", storeId);
         sc.setParameters("volume_id", volumeId);
         sc.setParameters("destroyed", false);
-        return findOneBy(sc);
+
+        /*
+        When we download volume then we create entry in volume_store_ref table.
+        We mark the volume entry to ready state once download_url gets generated.
+        When we migrate that volume, then again one more entry is created with same volume id.
+        Its state is marked as allocated. Later we try to list only one dataobject in datastore
+        for state transition during volume migration. If the listed volume's state is allocated
+        then migration passes otherwise it fails.
+
+         Below fix will remove the randomness and give priority to volume entry which is made for
+         migration (download_url/extracturl will be null in case of migration). Giving priority to
+         download volume case is not needed as there will be only one entry in that case so no randomness.
+        */
+        List<VolumeDataStoreVO> vos = listBy(sc);
+        if(vos.size() > 1) {
+            for(VolumeDataStoreVO vo : vos) {
+                if(vo.getExtractUrl() == null) {
+                    return vo;
+                }
+            }
+        }
+
+        return vos.size() == 1 ? vos.get(0) : null;
     }
 
     @Override


[2/2] git commit: updated refs/heads/master to ef99f01

Posted by bh...@apache.org.
Merge remote-tracking branch 'anshul/CLOUDSTACK-6900'

This closes #68

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


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

Branch: refs/heads/master
Commit: ef99f01e59aafc98feb034fff08c7ead28e69e2b
Parents: 085554d 91e1881
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Mon Mar 2 16:40:33 2015 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Mon Mar 2 16:40:44 2015 +0530

----------------------------------------------------------------------
 .../image/db/VolumeDataStoreDaoImpl.java        | 24 +++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------