cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prachida...@apache.org
Subject [30/50] [abbrv] git commit: updated refs/heads/affinity_groups to 857ed16
Date Fri, 29 Mar 2013 18:20:46 GMT
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/e3f67d12
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e3f67d12
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e3f67d12

Branch: refs/heads/affinity_groups
Commit: e3f67d126d66c31e027c96b5524667884084053b
Parents: 86a153c
Author: Sheng Yang <sheng.yang@citrix.com>
Authored: Thu Mar 28 15:02:45 2013 -0700
Committer: Sheng Yang <sheng.yang@citrix.com>
Committed: Thu Mar 28 15:54:07 2013 -0700

----------------------------------------------------------------------
 .../router/VirtualNetworkApplianceManagerImpl.java |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e3f67d12/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 45b11f7..78168b0 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -1277,13 +1277,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);


Mime
View raw message