mirror of https://github.com/apache/cloudstack.git
bug 10322: integrated into cluster management
This commit is contained in:
parent
e16a013335
commit
63f552995f
|
|
@ -69,7 +69,6 @@ import com.cloud.utils.component.ComponentLocator;
|
|||
import com.cloud.utils.component.Inject;
|
||||
import com.cloud.utils.concurrency.NamedThreadFactory;
|
||||
import com.cloud.utils.db.DB;
|
||||
import com.cloud.utils.db.Merovingian2;
|
||||
import com.cloud.utils.db.Transaction;
|
||||
import com.cloud.utils.events.SubscriptionMgr;
|
||||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
|
|
@ -1031,9 +1030,8 @@ public class ClusterManagerImpl implements ClusterManager {
|
|||
|
||||
|
||||
_agentLBEnabled = Boolean.valueOf(configDao.getValue(Config.AgentLbEnable.key()));
|
||||
|
||||
Merovingian2 m = Merovingian2.createLockMaster(this._msId);
|
||||
m.clear();
|
||||
|
||||
this.registerListener(new LockMasterListener(_msId));
|
||||
|
||||
checkConflicts();
|
||||
|
||||
|
|
|
|||
|
|
@ -21,11 +21,11 @@ import java.util.List;
|
|||
|
||||
import com.cloud.utils.db.Merovingian2;
|
||||
|
||||
public class LockTableListener implements ClusterManagerListener {
|
||||
public class LockMasterListener implements ClusterManagerListener {
|
||||
Merovingian2 _lockMaster;
|
||||
|
||||
public LockTableListener() {
|
||||
_lockMaster = Merovingian2.createLockMaster(ManagementServerNode.getManagementServerId());
|
||||
public LockMasterListener(long msId) {
|
||||
_lockMaster = Merovingian2.createLockMaster(msId);
|
||||
_lockMaster.clear();
|
||||
}
|
||||
|
||||
|
|
@ -36,7 +36,7 @@ public class LockTableListener implements ClusterManagerListener {
|
|||
@Override
|
||||
public void onManagementNodeLeft(List<ManagementServerHostVO> nodeList, long selfNodeId) {
|
||||
for (ManagementServerHostVO node : nodeList) {
|
||||
|
||||
_lockMaster.clear(node.getMsid());
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue