klsince commented on code in PR #15360:
URL: https://github.com/apache/pinot/pull/15360#discussion_r2017203421


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/rebalance/DefaultRebalancePreChecker.java:
##########
@@ -109,12 +111,17 @@ private RebalancePreCheckerResult 
checkReloadNeededOnServers(String rebalanceJob
     try (PoolingHttpClientConnectionManager connectionManager = new 
PoolingHttpClientConnectionManager()) {
       TableMetadataReader metadataReader = new 
TableMetadataReader(_executorService, connectionManager,
           _pinotHelixResourceManager);
+      // Only send needReload request to servers that are part of the current 
assignment. The tagged server list may
+      // include new servers which are part of target assignment but not 
current assignment. needReload throws an
+      // exception for servers that don't contain segments for the given table
+      Set<String> serverInstanceSet = 
getCurrentlyAssignedServerSet(currentAssignment);
       TableMetadataReader.TableReloadJsonResponse needsReloadMetadataPair =
-          
metadataReader.getServerCheckSegmentsReloadMetadata(tableNameWithType, 30_000);
+          
metadataReader.getServerSetCheckSegmentsReloadMetadata(tableNameWithType, 
30_000, serverInstanceSet);
       Map<String, JsonNode> needsReloadMetadata = 
needsReloadMetadataPair.getServerReloadJsonResponses();
       int failedResponses = needsReloadMetadataPair.getNumFailedResponses();
       LOGGER.info("Received {} needs reload responses and {} failed responses 
from servers for table: {} with "
-          + "rebalanceJobId: {}", needsReloadMetadata.size(), failedResponses, 
tableNameWithType, rebalanceJobId);
+          + "rebalanceJobId: {}, serverSet queried: {}", 
needsReloadMetadata.size(), failedResponses, tableNameWithType,

Review Comment:
   would it be too verbose to log out `serverInstanceSet`, maybe just log out 
the count of servers



##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/rebalance/DefaultRebalancePreChecker.java:
##########
@@ -208,6 +215,14 @@ private RebalancePreCheckerResult 
checkIsMinimizeDataMovement(String rebalanceJo
     }
   }
 
+  private Set<String> getCurrentlyAssignedServerSet(Map<String, Map<String, 
String>> currentAssignment) {
+    Set<String> serverList = new HashSet<>();

Review Comment:
   nit: simply `servers`, removing `List` in the name as this is a Set
   
   nit: maybe rename method to `getCurrentlyAssignedServers` to be a bit 
generic, although we probably won't change the return type to a different 
Collection.



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to