mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
bug 11326: don't try to transfer the agent if it's a forward agent
status 11326: resolved fixed Also added more logging to the agent rebalance code. Conflicts: server/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java
This commit is contained in:
parent
13ee22d421
commit
ba2c6695cc
@ -878,6 +878,7 @@ public class ClusteredAgentManagerImpl extends AgentManagerImpl implements Clust
|
||||
// if the thread:
|
||||
// 1) timed out waiting for the host to reconnect
|
||||
// 2) recipient management server is not active any more
|
||||
// 3) if the management server doesn't own the host any more
|
||||
// remove the host from re-balance list and delete from op_host_transfer DB
|
||||
// no need to do anything with the real attache as we haven't modified it yet
|
||||
Date cutTime = DateUtil.currentGMTTime();
|
||||
@ -886,7 +887,14 @@ public class ClusteredAgentManagerImpl extends AgentManagerImpl implements Clust
|
||||
iterator.remove();
|
||||
_hostTransferDao.completeAgentTransfer(hostId);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (attache.forForward()) {
|
||||
s_logger.debug("Management server " + _nodeId + " doesn't own host id=" + hostId + " any more, skipping rebalance for the host");
|
||||
iterator.remove();
|
||||
_hostTransferDao.completeAgentTransfer(hostId);
|
||||
continue;
|
||||
}
|
||||
|
||||
HostTransferMapVO transferMap = _hostTransferDao.findByIdAndCurrentOwnerId(hostId, _nodeId);
|
||||
|
||||
@ -1017,9 +1025,10 @@ public class ClusteredAgentManagerImpl extends AgentManagerImpl implements Clust
|
||||
logD(requestToTransfer.getBytes(), "Failed to route request to peer");
|
||||
}
|
||||
|
||||
requestToTransfer = forwardAttache.getRequestToTransfer();
|
||||
}
|
||||
s_logger.debug("Management server " + _nodeId + " completed agent " + hostId + " rebalance");
|
||||
requestToTransfer = forwardAttache.getRequestToTransfer();
|
||||
}
|
||||
|
||||
s_logger.debug("Management server " + _nodeId + " completed agent " + hostId + " rebalance to " + futureOwnerId);
|
||||
|
||||
} else {
|
||||
failRebalance(hostId);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user