You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ch...@apache.org on 2013/03/30 21:27:44 UTC
git commit: updated refs/heads/4.1 to 9cf20ae
Updated Branches:
refs/heads/4.1 80c588e6b -> 9cf20ae38
CLOUDSTACK-1827: Fix redundant router update mechanism
There is a bug that if the smaller number ID RvR stop running, that pair of
RvR's status won't be updated. This patch fixed it.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9cf20ae3
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9cf20ae3
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9cf20ae3
Branch: refs/heads/4.1
Commit: 9cf20ae38bb2917afb50dae0f6cd76eb05c18178
Parents: 80c588e
Author: Sheng Yang <sh...@citrix.com>
Authored: Thu Mar 28 15:02:45 2013 -0700
Committer: Chip Childers <ch...@gmail.com>
Committed: Sat Mar 30 20:23:48 2013 +0000
----------------------------------------------------------------------
.../router/VirtualNetworkApplianceManagerImpl.java | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9cf20ae3/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index 1e1046f..8b75b00 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -1280,13 +1280,22 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
* We update the router pair which the lower id router owned by this mgmt server, in order
* to prevent duplicate update of router status from cluster mgmt servers
*/
- DomainRouterVO router = routers.get(0);
- if (routers.get(1).getId() < router.getId()) {
- router = routers.get(1);
+ DomainRouterVO router0 = routers.get(0);
+ DomainRouterVO router1 = routers.get(1);
+ DomainRouterVO router = router0;
+ if ((router0.getId() < router1.getId()) && router0.getHostId() != null) {
+ router = router0;
+ } else {
+ router = router1;
+ }
+ if (router.getHostId() == null) {
+ s_logger.debug("Skip router pair (" + router0.getInstanceName() + "," + router1.getInstanceName() + ") due to can't find host");
+ continue;
}
HostVO host = _hostDao.findById(router.getHostId());
if (host == null || host.getManagementServerId() == null ||
host.getManagementServerId() != ManagementServerNode.getManagementServerId()) {
+ s_logger.debug("Skip router pair (" + router0.getInstanceName() + "," + router1.getInstanceName() + ") due to not belong to this mgmt server");
continue;
}
updateRoutersRedundantState(routers);