This is an automated email from the ASF dual-hosted git repository.

jackie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new d6f22ac976 Fix the NPE for rebalance retry (#11883)
d6f22ac976 is described below

commit d6f22ac976302a6360bd3dd64230b31881cc4c00
Author: Xiaotian (Jackie) Jiang <17555551+jackie-ji...@users.noreply.github.com>
AuthorDate: Thu Oct 26 15:03:53 2023 -0700

    Fix the NPE for rebalance retry (#11883)
---
 .../controller/helix/core/rebalance/RebalanceChecker.java   | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git 
a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/rebalance/RebalanceChecker.java
 
b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/rebalance/RebalanceChecker.java
index 93e4b04dcb..ddd7a0df13 100644
--- 
a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/rebalance/RebalanceChecker.java
+++ 
b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/rebalance/RebalanceChecker.java
@@ -91,15 +91,12 @@ public class RebalanceChecker extends 
ControllerPeriodicTask<Void> {
       tableJobMetadataMap.computeIfAbsent(tableNameWithType, k -> new 
HashMap<>()).put(jobId, jobMetadata);
     });
     int numTablesProcessed = 0;
-    for (String tableNameWithType : tableNamesWithType) {
+    for (Map.Entry<String, Map<String, Map<String, String>>> entry : 
tableJobMetadataMap.entrySet()) {
+      String tableNameWithType = entry.getKey();
+      Map<String, Map<String, String>> allJobMetadata = entry.getValue();
       try {
-        LOGGER.info("Start to retry rebalance for table: {}", 
tableNameWithType);
-        // Get all rebalance jobs as tracked in ZK for this table to check if 
there is any failure to retry.
-        Map<String, Map<String, String>> allJobMetadata = 
tableJobMetadataMap.get(tableNameWithType);
-        if (allJobMetadata.isEmpty()) {
-          LOGGER.info("No rebalance job has been triggered for table: {}. Skip 
retry", tableNameWithType);
-          continue;
-        }
+        LOGGER.info("Start to retry rebalance for table: {} with {} rebalance 
jobs tracked", tableNameWithType,
+            allJobMetadata.size());
         retryRebalanceTable(tableNameWithType, allJobMetadata);
         numTablesProcessed++;
       } catch (Exception e) {


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

Reply via email to