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_r186700187
##########
File path: server/src/com/cloud/network/vpc/VpcManagerImpl.java
##########
@@ -2435,4 +2444,43 @@ public boolean isSrcNatIpRequired(long vpcOfferingId) {
final Map<Network.Service, Set<Network.Provider>>
vpcOffSvcProvidersMap = getVpcOffSvcProvidersMap(vpcOfferingId);
return
vpcOffSvcProvidersMap.get(Network.Service.SourceNat).contains(Network.Provider.VPCVirtualRouter);
}
+
+ private boolean rollingRestartVpc(final Vpc vpc, final ReservationContext
context) throws ResourceUnavailableException, ConcurrentOperationException,
InsufficientCapacityException {
+ s_logger.debug("Performing rolling restart of routers of VPC " + vpc);
+ _ntwkMgr.destroyExpendableRouters(_routerDao.listByVpcId(vpc.getId()),
context);
+
+ final DeployDestination dest = new
DeployDestination(_dcDao.findById(vpc.getZoneId()), null, null, null);
+ final List<DomainRouterVO> oldRouters =
_routerDao.listByVpcId(vpc.getId());
+
+ // Create a new router
+ if (oldRouters.size() > 0) {
+ vpc.setRollingRestart(true);
+ }
+ startVpc(vpc, dest, context);
+ if (oldRouters.size() > 0) {
Review comment:
Can you explain this logic here? I mean, it is the same as the one at line
2456, but when it solves to true there, we set `vpc.setRollingRestart(true);`
and then we set `vpc.setRollingRestart(false);` here. Is this something that
was done only to satisfy some conditional at `startVpc`?
----------------------------------------------------------------
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