From dev-return-62053-archive-asf-public=cust-asf.ponee.io@storm.apache.org Thu Jul 9 18:48:24 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 94BC5180607 for ; Thu, 9 Jul 2020 20:48:24 +0200 (CEST) Received: (qmail 92802 invoked by uid 500); 9 Jul 2020 18:48:23 -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 92790 invoked by uid 99); 9 Jul 2020 18:48:23 -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; Thu, 09 Jul 2020 18:48:23 +0000 From: =?utf-8?q?GitBox?= To: dev@storm.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bstorm=5D_Ethanlm_commented_on_a_change_in_pull_req?= =?utf-8?q?uest_=233302=3A_=5BSTORM-3666=5D_Validate_component_name_in_rebal?= =?utf-8?q?ance_command?= Message-ID: <159432050366.29655.6172606434101101238.asfpy@gitbox.apache.org> Date: Thu, 09 Jul 2020 18:48:23 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit In-Reply-To: References: Ethanlm commented on a change in pull request #3302: URL: https://github.com/apache/storm/pull/3302#discussion_r452420749 ########## File path: storm-server/src/main/java/org/apache/storm/daemon/nimbus/Nimbus.java ########## @@ -3380,16 +3381,21 @@ public void rebalance(String topoName, RebalanceOptions options) options.set_principal(null); // check if executor counts are correctly specified StormTopology stormTopology = tryReadTopologyFromName(topoName); - Set comps = new HashSet<>(); + Set comps = new TreeSet<>(); 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 (Map.Entry e: execOverrides.entrySet()) { String comp = e.getKey(); - Integer value = e.getValue(); - if (!comps.contains(comp)) { - throw new WrappedInvalidTopologyException(String.format("Component %s does not exist in topology %s", comp, topoName)); + // validate non-system component ids + if (!Utils.isSystemId(comp) && !comps.contains(comp)) { Review comment: Maybe we can follow the code at https://github.com/apache/storm/blob/master/storm-server/src/main/java/org/apache/storm/daemon/nimbus/Nimbus.java#L2638-L2639 to get all the 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