cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [41/50] [abbrv] git commit: updated refs/heads/feature/systemvm-persistent-config to 8620642
Date Mon, 16 Feb 2015 16:48:22 GMT
Fix checkSanity. We do not need to check the priority anymore.
   - It's taken care by VRRP.

wip: clean up where priority is still used.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/31eb1586
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/31eb1586
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/31eb1586

Branch: refs/heads/feature/systemvm-persistent-config
Commit: 31eb15862380c2438e29719d1aa5f457ca024e63
Parents: 5937518
Author: wilderrodrigues <wrodrigues@schubergphilis.com>
Authored: Fri Feb 6 14:12:40 2015 +0100
Committer: wilderrodrigues <wrodrigues@schubergphilis.com>
Committed: Mon Feb 16 16:08:45 2015 +0100

----------------------------------------------------------------------
 .../VirtualNetworkApplianceManagerImpl.java     | 24 +++++++++++++-------
 1 file changed, 16 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/31eb1586/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 1ad7a9f..588a354 100644
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -1077,10 +1077,19 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine>
{
                         continue;
                     }
                     checkedNetwork.add(routerGuestNtwkId);
-                    final List<DomainRouterVO> checkingRouters = _routerDao.listByNetworkAndRole(routerGuestNtwkId,
Role.VIRTUAL_ROUTER);
+                    
+                    final List<DomainRouterVO> checkingRouters;
+                    Long vpcId = router.getVpcId();
+                    if (vpcId != null) {
+                        checkingRouters = _routerDao.listByVpcId(vpcId);
+                    } else {
+                        checkingRouters = _routerDao.listByNetworkAndRole(routerGuestNtwkId,
Role.VIRTUAL_ROUTER);
+                    }
+                    
                     if (checkingRouters.size() != 2) {
                         continue;
                     }
+                    
                     DomainRouterVO masterRouter = null;
                     DomainRouterVO backupRouter = null;
                     for (final DomainRouterVO r : checkingRouters) {
@@ -1088,23 +1097,22 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine>
{
                             if (masterRouter == null) {
                                 masterRouter = r;
                             } else {
-                                // Duplicate master! We give up, until the admin
-                                // fix duplicate MASTER issue
+                                // Wilder Rodrigues (wrodrigues@schubergphilis.com
+                                // Force a restart in order to fix the conflict
+                                recoverRedundantNetwork(masterRouter, r);
                                 break;
                             }
                         } else if (r.getRedundantState() == RedundantState.BACKUP) {
                             if (backupRouter == null) {
                                 backupRouter = r;
                             } else {
+                                // Wilder Rodrigues (wrodrigues@schubergphilis.com
+                                // Do we have 2 routers in Backup state? Perhaps a restart
of 1 router is needed.
+                                recoverRedundantNetwork(backupRouter, r);
                                 break;
                             }
                         }
                     }
-                    if (masterRouter != null && backupRouter != null) {
-                        if (_nwHelper.getRealPriority(masterRouter) - DEFAULT_DELTA + 1 !=
_nwHelper.getRealPriority(backupRouter) || backupRouter.getIsPriorityBumpUp()) {
-                            recoverRedundantNetwork(masterRouter, backupRouter);
-                        }
-                    }
                 }
             }
         }


Mime
View raw message