rafaelweingartner commented on a change in pull request #2508: CLOUDSTACK-9114:
Reduce VR downtime during network restart
URL: https://github.com/apache/cloudstack/pull/2508#discussion_r178032230
##########
File path:
engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
##########
@@ -2868,6 +2876,82 @@ public boolean restartNetwork(final Long networkId,
final Account callerAccount,
}
}
+ @Override
+ public VirtualRouter findExpendableRouterForRollingRestart(final List<?
extends VirtualRouter> routers) {
+ VirtualRouter expendableRouter = null;
+ if (routers != null && routers.size() > 1) {
+ for (final VirtualRouter router : routers) {
+ if (router.getRedundantState() !=
VirtualRouter.RedundantState.MASTER) {
+ expendableRouter = router;
+ }
+ }
+ if (expendableRouter == null) {
+ expendableRouter = routers.get(routers.size() - 1);
+ }
+ }
+ return expendableRouter;
+ }
+
+ private boolean rollingRestartRouters(final NetworkVO network, final
NetworkOffering offering, final List<DomainRouterVO> oldRouters, final
ReservationContext context) throws ResourceUnavailableException,
ConcurrentOperationException, InsufficientCapacityException {
+ final Account callerAccount =
CallContext.current().getCallingAccount();
Review comment:
Can you break this method into smaller ones? It is quite big already.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services