cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [05/50] [abbrv] git commit: updated refs/heads/marvin-refactor to 5ce2643
Date Sat, 30 Mar 2013 16:56:18 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/4e0742e4
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4e0742e4
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4e0742e4

Branch: refs/heads/marvin-refactor
Commit: 4e0742e4127c82177148cbf1095ba980cc6beb27
Parents: a2709a2
Author: Sheng Yang <sheng.yang@citrix.com>
Authored: Thu Mar 28 15:02:45 2013 -0700
Committer: Prasanna Santhanam <tsp@apache.org>
Committed: Sat Mar 30 22:21:52 2013 +0530

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4e0742e4/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 50188e7..0c2791c 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