cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [1/2] git commit: updated refs/heads/4.2 to 848abfd
Date Thu, 08 Aug 2013 23:09:02 GMT
Updated Branches:
  refs/heads/4.2 e1bd0ee03 -> 848abfd38


CLOUDSTACK-4190: Add endpoint selector implementation for ImageCache
data store and also delete object from staging area for volume copy from
primary to secondary or vice versa.


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

Branch: refs/heads/4.2
Commit: 848abfd384d382598af316309d03e689d537f3a5
Parents: 605376d
Author: Min Chen <min.chen@citrix.com>
Authored: Thu Aug 8 16:08:31 2013 -0700
Committer: Min Chen <min.chen@citrix.com>
Committed: Thu Aug 8 16:08:50 2013 -0700

----------------------------------------------------------------------
 .../storage/motion/AncientDataMotionStrategy.java        | 11 ++++++++---
 .../storage/endpoint/DefaultEndPointSelector.java        |  4 ++--
 server/src/com/cloud/storage/VolumeManagerImpl.java      |  4 ----
 3 files changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/848abfd3/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
----------------------------------------------------------------------
diff --git a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
index b81af5f..4a1597a 100644
--- a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
+++ b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
@@ -181,7 +181,6 @@ public class AncientDataMotionStrategy implements DataMotionStrategy {
         int _primaryStorageDownloadWait = NumbersUtil.parseInt(value,
                 Integer.parseInt(Config.PrimaryStorageDownloadWait.getDefaultValue()));
         Answer answer = null;
-        boolean usingCache = false;
         DataObject cacheData = null;
         DataObject srcForCopy = srcData;
         try {
@@ -195,10 +194,16 @@ public class AncientDataMotionStrategy implements DataMotionStrategy
{
             answer = ep.sendMessage(cmd);
 
             if (cacheData != null) {
-                if (answer == null || !answer.getResult()) {
+                if (srcData.getType() == DataObjectType.VOLUME && destData.getType()
== DataObjectType.VOLUME) {
+                    // volume transfer from primary to secondary or vice versa. Volume transfer
between primary pools are already handled by copyVolumeBetweenPools
                     cacheMgr.deleteCacheObject(srcForCopy);
                 } else {
-                    cacheMgr.releaseCacheObject(srcForCopy);
+                    // for template, we want to leave it on cache for performance reason
+                    if (answer == null || !answer.getResult()) {
+                        cacheMgr.deleteCacheObject(srcForCopy);
+                    } else {
+                        cacheMgr.releaseCacheObject(srcForCopy);
+                    }
                 }
             }
             return answer;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/848abfd3/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
b/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
index 26c0e7e..d2ddfd4 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
@@ -102,7 +102,7 @@ public class DefaultEndPointSelector implements EndPointSelector {
             sbuilder.append(scope.getScopeId());
         } else if (scope.getScopeType() == ScopeType.ZONE) {
             sbuilder.append(" and data_center_id = ");
-            sbuilder.append(scope.getScopeId());	
+            sbuilder.append(scope.getScopeId());
         }
         // TODO: order by rand() is slow if there are lot of hosts
         sbuilder.append(" ORDER by rand() limit 1");
@@ -221,7 +221,7 @@ public class DefaultEndPointSelector implements EndPointSelector {
     public EndPoint select(DataStore store) {
         if (store.getRole() == DataStoreRole.Primary) {
             return findEndpointForPrimaryStorage(store);
-        } else if (store.getRole() == DataStoreRole.Image) {
+        } else if (store.getRole() == DataStoreRole.Image || store.getRole() == DataStoreRole.ImageCache)
{
             // in case there is no ssvm, directly send down command hypervisor
             // host
             // otherwise, send to localhost for bootstrap system vm template

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/848abfd3/server/src/com/cloud/storage/VolumeManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeManagerImpl.java b/server/src/com/cloud/storage/VolumeManagerImpl.java
index 419e0b4..e1cb181 100644
--- a/server/src/com/cloud/storage/VolumeManagerImpl.java
+++ b/server/src/com/cloud/storage/VolumeManagerImpl.java
@@ -2788,12 +2788,8 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager
{
 
         // Clean up code to remove all those previous uploadVO and uploadMonitor code. Previous
code is trying to fake an async operation purely in
         // db table with uploadVO and async_job entry, but internal implementation is actually
synchronous.
-        StoragePool srcPool = (StoragePool) dataStoreMgr.getPrimaryDataStore(volume.getPoolId());
         ImageStoreEntity secStore = (ImageStoreEntity) dataStoreMgr.getImageStore(zoneId);
-        String secondaryStorageURL = secStore.getUri();
 
-        String value = _configDao.getValue(Config.CopyVolumeWait.toString());
-        int copyvolumewait = NumbersUtil.parseInt(value, Integer.parseInt(Config.CopyVolumeWait.getDefaultValue()));
         // Copy volume from primary to secondary storage
         VolumeInfo srcVol = volFactory.getVolume(volume.getId());
         AsyncCallFuture<VolumeApiResult> cvAnswer = volService.copyVolume(srcVol, secStore);


Mime
View raw message