somandal commented on code in PR #15266:
URL: https://github.com/apache/pinot/pull/15266#discussion_r2025535644


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/rebalance/TableRebalancer.java:
##########
@@ -1145,8 +1174,8 @@ static boolean isExternalViewConverged(String 
tableNameWithType,
         }
       }
 
-      // For low disk mode, check if there are extra instances in ExternalView 
that are not in IdealState
-      if (lowDiskMode && externalViewInstanceStateMap != null) {
+      // Check if there are extra instances in ExternalView that are not in 
IdealState
+      if (externalViewInstanceStateMap != null) {

Review Comment:
   done - removed this. will open a separate PR later



##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/rebalance/TableRebalanceProgressStats.java:
##########
@@ -127,4 +163,77 @@ public static boolean statsDiffer(RebalanceStateStats 
base, RebalanceStateStats
     }
     return false;
   }
+
+  // TODO: Clean this up once new stats are verified
+  public static class RebalanceStateStats {
+    public int _segmentsMissing;
+    public int _segmentsToRebalance;
+    public double _percentSegmentsToRebalance;
+    public int _replicasToRebalance;
+
+    RebalanceStateStats() {
+      _segmentsMissing = 0;
+      _segmentsToRebalance = 0;
+      _replicasToRebalance = 0;
+      _percentSegmentsToRebalance = 0.0;
+    }
+  }
+
+  // These rebalance stats specifically track the total segments added / 
deleted across all replicas
+  public static class RebalanceProgressStats {
+    // Total segments - across all replicas
+    @JsonProperty("totalSegmentsToBeAdded")
+    public int _totalSegmentsToBeAdded;
+    @JsonProperty("totalSegmentsToBeDeleted")
+    public int _totalSegmentsToBeDeleted;
+    // Total segments processed so far - across all replicas
+    @JsonProperty("totalRemainingSegmentsToBeAdded")
+    public int _totalRemainingSegmentsToBeAdded;
+    @JsonProperty("totalRemainingSegmentsToBeDeleted")
+    public int _totalRemainingSegmentsToBeDeleted;
+    @JsonProperty("totalRemainingSegmentsToConverge")
+    public int _totalRemainingSegmentsToConverge;
+    // Carry over stats - for when previous step's convergence doesn't 
complete and next step starts (bestEffort=true)
+    @JsonProperty("totalCarryOverSegmentsToBeAdded")
+    public int _totalCarryOverSegmentsToBeAdded;
+    @JsonProperty("totalCarryOverSegmentsToBeDeleted")
+    public int _totalCarryOverSegmentsToBeDeleted;
+    // Total new segments stats (not tracked by rebalance)
+    @JsonProperty("totalUniqueNewUntrackedSegmentsDuringRebalance")
+    public int _totalUniqueNewUntrackedSegmentsDuringRebalance;
+    // Derived stats
+    @JsonProperty("percentageTotalSegmentsAddsRemaining")
+    public double _percentageTotalSegmentsAddsRemaining;

Review Comment:
   done



##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/rebalance/TableRebalanceProgressStats.java:
##########
@@ -118,6 +127,33 @@ public RebalanceStateStats getCurrentToTargetConvergence() 
{
     return _currentToTargetConvergence;
   }
 
+  public RebalanceProgressStats getRebalanceProgressStatsOverall() {
+    return _rebalanceProgressStatsOverall;
+  }
+
+  public RebalanceProgressStats getRebalanceProgressStatsCurrentStep() {
+    return _rebalanceProgressStatsCurrentStep;
+  }
+
+  public static boolean progressStatsDiffer(RebalanceProgressStats base, 
RebalanceProgressStats compare) {

Review Comment:
   done



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