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


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/rebalance/TableRebalancer.java:
##########
@@ -1813,9 +1865,63 @@ public int fetch(String segmentName) {
     }
   }
 
+  @VisibleForTesting
+  @FunctionalInterface
+  interface DataLossRiskAssessor {
+    boolean hasDataLossRisk(String segmentName);
+  }
+
+  private static class DataLossRiskAssessorImpl implements 
DataLossRiskAssessor {
+    private final String _tableNameWithType;
+    private final HelixManager _helixManager;
+    private final boolean _isPeerDownloadEnabled;
+    private final boolean _isUpsertOrDedupTable;
+    private final boolean _isPauselessEnabled;
+
+    private DataLossRiskAssessorImpl(String tableNameWithType, TableConfig 
tableConfig, HelixManager helixManager) {
+      _tableNameWithType = tableNameWithType;
+      _helixManager = helixManager;
+      _isPeerDownloadEnabled = 
!StringUtils.isEmpty(tableConfig.getValidationConfig().getPeerSegmentDownloadScheme());
+      _isUpsertOrDedupTable = tableConfig.isUpsertEnabled() || 
tableConfig.isDedupEnabled();
+      _isPauselessEnabled = 
PauselessConsumptionUtils.isPauselessEnabled(tableConfig);
+    }
+
+    @Override
+    public boolean hasDataLossRisk(String segmentName) {

Review Comment:
   good catch, i've passed in the minAvailableReplicas value to ensure we 
return false if that is > 0.
   
   Downtime rebalance never reaches here, we actually directly update the IS 
with all updates and return. Do you think we should add some validations for 
peer-download enabled before making the IS update to check the status of each 
segment in that case as well?



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