From dev-return-62034-archive-asf-public=cust-asf.ponee.io@storm.apache.org Mon Jul 6 19:14:53 2020 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 [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 36E5318062C for ; Mon, 6 Jul 2020 21:14:53 +0200 (CEST) Received: (qmail 95508 invoked by uid 500); 6 Jul 2020 19:14:52 -0000 Mailing-List: contact dev-help@storm.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@storm.apache.org Delivered-To: mailing list dev@storm.apache.org Received: (qmail 95496 invoked by uid 99); 6 Jul 2020 19:14:52 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Jul 2020 19:14:52 +0000 From: =?utf-8?q?GitBox?= To: dev@storm.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bstorm=5D_bipinprasad_commented_on_a_change_in_pull?= =?utf-8?q?_request_=233302=3A_=5BSTORM-3666=5D_Validate_component_name_in_r?= =?utf-8?q?ebalance_command?= Message-ID: <159406289226.29655.1813749378105972758.asfpy@gitbox.apache.org> Date: Mon, 06 Jul 2020 19:14:52 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit In-Reply-To: References: bipinprasad commented on a change in pull request #3302: URL: https://github.com/apache/storm/pull/3302#discussion_r450428089 ########## File path: storm-server/src/main/java/org/apache/storm/daemon/nimbus/Nimbus.java ########## @@ -3370,8 +3378,18 @@ public void rebalance(String topoName, RebalanceOptions options) checkAuthorization(topoName, topoConf, operation); // Set principal in RebalanceOptions to nil because users are not suppose to set this options.set_principal(null); + // check if executor counts are correctly specified + StormTopology stormTopology = tryReadTopologyFromName(topoName); + Set comps = new HashSet<>(); + comps.addAll(stormTopology.get_spouts().keySet()); + comps.addAll(stormTopology.get_bolts().keySet()); Map execOverrides = options.is_set_num_executors() ? options.get_num_executors() : Collections.emptyMap(); - for (Integer value : execOverrides.values()) { + for (Map.Entry e: execOverrides.entrySet()) { + String comp = e.getKey(); + Integer value = e.getValue(); + if (!comps.contains(comp)) { Review comment: This check will preclude rebalancing system components. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to 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