From issues-return-91611-archive-asf-public=cust-asf.ponee.io@cloudstack.apache.org Thu Mar 29 14:04:06 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 56AA1180645 for ; Thu, 29 Mar 2018 14:04:06 +0200 (CEST) Received: (qmail 74784 invoked by uid 500); 29 Mar 2018 12:04:05 -0000 Mailing-List: contact issues-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list issues@cloudstack.apache.org Received: (qmail 74775 invoked by uid 500); 29 Mar 2018 12:04:05 -0000 Delivered-To: apmail-incubator-cloudstack-issues@incubator.apache.org Received: (qmail 74772 invoked by uid 99); 29 Mar 2018 12:04:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Mar 2018 12:04:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 03BCCC2E5D for ; Thu, 29 Mar 2018 12:04:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id mxmYT1myCMaY for ; Thu, 29 Mar 2018 12:04:04 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 679BC5FB93 for ; Thu, 29 Mar 2018 12:04:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 6CBCDE0E72 for ; Thu, 29 Mar 2018 12:04:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id CB399255F5 for ; Thu, 29 Mar 2018 12:04:00 +0000 (UTC) Date: Thu, 29 Mar 2018 12:04:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: cloudstack-issues@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CLOUDSTACK-9114) restartnetwork with cleanup should not update/restart both routers at once MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CLOUDSTACK-9114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16418855#comment-16418855 ] ASF GitHub Bot commented on CLOUDSTACK-9114: -------------------------------------------- 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_r178032100 ########## 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 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 oldRouters, final ReservationContext context) throws ResourceUnavailableException, ConcurrentOperationException, InsufficientCapacityException { + final Account callerAccount = CallContext.current().getCallingAccount(); + final long callerUserId = CallContext.current().getCallingUserId(); + final DeployDestination dest = new DeployDestination(_dcDao.findById(network.getDataCenterId()), null, null, null); + final List providersToImplement = getNetworkProviders(network.getId()); + + // Find and destroy any expendable router + final VirtualRouter expendableRouter = findExpendableRouterForRollingRestart(oldRouters); + if (expendableRouter != null) { + _routerService.destroyRouter(expendableRouter.getId(), callerAccount, callerUserId); + } + final List remainingOldRouters = _routerDao.findByNetwork(network.getId()); + + // Create a new router + network.setRollingRestart(true); + implementNetworkElements(dest, context, network, offering, providersToImplement); + network.setRollingRestart(false); + + if (network.isRedundant()) { + try { + // For redundant network wait for 3*(1+skew_seconds) for VRRP to kick in + Thread.sleep(10000L); + } catch (final InterruptedException ignored) { Review comment: Please, do not hide exceptions. You should at least log them. ---------------------------------------------------------------- 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: users@infra.apache.org > restartnetwork with cleanup should not update/restart both routers at once > -------------------------------------------------------------------------- > > Key: CLOUDSTACK-9114 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9114 > Project: CloudStack > Issue Type: Improvement > Security Level: Public(Anyone can view this level - this is the default.) > Reporter: Wei Zhou > Assignee: Wei Zhou > Priority: Major > > for now, restartnetwork with cleanup will stop both RVRs at first, then start two new RVRs. > to reduce the downtime of network, we'd better restart the RVRs one by one. -- This message was sent by Atlassian JIRA (v7.6.3#76005)