Fix for a corner case during fullsync where it tolerates a VM to exist on two 
clusters by virtue of it’s current host id and last host id (being on two 
diff clusters).


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

Branch: refs/heads/javelin
Commit: 6f26894eafce34cb2ba05285520cb5cf6cccc65a
Parents: e6ef698
Author: Abhinandan Prateek <[email protected]>
Authored: Thu Aug 23 12:13:53 2012 +0530
Committer: Abhinandan Prateek <[email protected]>
Committed: Thu Aug 23 12:13:53 2012 +0530

----------------------------------------------------------------------
 server/src/com/cloud/vm/dao/VMInstanceDaoImpl.java |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6f26894e/server/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/dao/VMInstanceDaoImpl.java 
b/server/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
index db4ab16..571b5d1 100644
--- a/server/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
+++ b/server/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
@@ -117,6 +117,7 @@ public class VMInstanceDaoImpl extends 
GenericDaoBase<VMInstanceVO, Long> implem
         LHVMClusterSearch = createSearchBuilder();
         SearchBuilder<HostVO> hostSearch1 = _hostDao.createSearchBuilder();
         LHVMClusterSearch.join("hostSearch1", hostSearch1, 
hostSearch1.entity().getId(), LHVMClusterSearch.entity().getLastHostId(), 
JoinType.INNER);
+        LHVMClusterSearch.and("hostid", 
LHVMClusterSearch.entity().getHostId(), Op.NULL);
         hostSearch1.and("clusterId", hostSearch1.entity().getClusterId(), 
SearchCriteria.Op.EQ);
         LHVMClusterSearch.done();
 

Reply via email to