akhileshchg commented on code in PR #21654:
URL: https://github.com/apache/kafka/pull/21654#discussion_r2898358508


##########
tools/src/main/java/org/apache/kafka/tools/reassign/ReassignPartitionsCommand.java:
##########
@@ -499,8 +510,10 @@ static String 
replicaMoveStatesToString(Map<TopicPartitionReplica, LogDirMoveSta
     private static void clearAllThrottles(Admin adminClient,
                                           List<Entry<TopicPartition, 
List<Integer>>> targetParts
     ) throws ExecutionException, InterruptedException {
-        Set<Integer> brokers = 
adminClient.describeCluster().nodes().get().stream().map(Node::id).collect(Collectors.toSet());
+        Set<Integer> liveBrokers = getLiveBrokerIds(adminClient);
+        Set<Integer> brokers = new HashSet<>(liveBrokers);
         targetParts.forEach(t -> brokers.addAll(t.getValue()));
+        brokers.retainAll(liveBrokers);

Review Comment:
   the `retainAll(liveBrokers)` after `addAll(t.getValue())` makes the addAll a 
no-op. If that is the intended behavior, we might as well simply use 
`liveBrokers`. 



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to