bug CS-15978: 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).

reviewed-by: Murali
This commit is contained in:
Abhinandan Prateek 2012-08-22 12:36:14 +05:30
parent e1ca140fe6
commit 70ec6089ac
1 changed files with 1 additions and 0 deletions

View File

@ -113,6 +113,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();