Jackie-Jiang commented on code in PR #16444:
URL: https://github.com/apache/pinot/pull/16444#discussion_r2246016025
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/SegmentStatusChecker.java:
##########
@@ -397,9 +397,9 @@ private void updateSegmentMetrics(String tableNameWithType,
TableConfig tableCon
}
minEVReplicasUp = Math.min(minEVReplicasUp, numEVReplicasUp);
- // Total number of replicas in ideal state (including ERROR/OFFLINE
states)
- int numISReplicasTotal =
Math.max(idealState.getInstanceStateMap(segment).entrySet().size(), 1);
- minEVReplicasUpPercent = Math.min(minEVReplicasUpPercent,
numEVReplicasUp * 100 / numISReplicasTotal);
+ // Use max replicas up from IS and EV to ensure availability does not go
above 100%
+ int maxReplicasUp = Math.max(numISReplicasUp, numEVReplicasUp);
Review Comment:
We don't need this because `numEVReplicasUp` is already capped at
`numISReplicasUp` on line 396
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/SegmentStatusChecker.java:
##########
@@ -397,9 +397,9 @@ private void updateSegmentMetrics(String tableNameWithType,
TableConfig tableCon
}
minEVReplicasUp = Math.min(minEVReplicasUp, numEVReplicasUp);
- // Total number of replicas in ideal state (including ERROR/OFFLINE
states)
- int numISReplicasTotal =
Math.max(idealState.getInstanceStateMap(segment).entrySet().size(), 1);
Review Comment:
I believe the reason for this is to also count the segments running into
error during consumption, where IS is set to `OFFLINE` (IS can never be
`ERROR`). I feel the existing logic is correct. We might want to add some
comments explaining this
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]