J-HowHuang commented on code in PR #19221:
URL: https://github.com/apache/pinot/pull/19221#discussion_r3770511790


##########
pinot-broker/src/main/java/org/apache/pinot/broker/routing/instanceselector/BaseInstanceSelector.java:
##########
@@ -326,12 +409,25 @@ void refreshSegmentStates() {
         new 
HashMap<>(HashUtil.getHashMapCapacity(_oldSegmentCandidatesMap.size() + 
_newSegmentStateMap.size()));
     Set<String> servingInstances = new HashSet<>();
     Set<String> unavailableSegments = new HashSet<>();
+    int minPercentOfReplicas = SegmentReplicaHealth.FULLY_REPLICATED_PERCENT;
+    int numSegmentsWithoutRedundancy = 0;
 
     for (Map.Entry<String, List<SegmentInstanceCandidate>> entry : 
_oldSegmentCandidatesMap.entrySet()) {
       String segment = entry.getKey();
       List<SegmentInstanceCandidate> candidates = entry.getValue();
       List<SegmentInstanceCandidate> enabledCandidates =
           getEnabledCandidatesAndAddToServingInstances(candidates, 
servingInstances);
+      if (_emitReplicaHealthMetrics) {
+        int expectedReplicas = getExpectedReplicas(segment, candidates.size());
+        int servingReplicas = enabledCandidates.size();
+        if (SegmentReplicaHealth.shouldMeasure(expectedReplicas)) {
+          minPercentOfReplicas = Math.min(minPercentOfReplicas,
+              SegmentReplicaHealth.toPercent(servingReplicas, 
expectedReplicas));

Review Comment:
   The trade-off to include RF=1 segments is for tables mixed with different 
RF, e.g. RF=3 for consuming and completed segments and RF=1 for tier. The gauge 
value would be dominated by those segment reporting 0% while rolling restart or 
rebalance. We're not able to measure the replica percent that we're interested 
in.
   
   imho RF=1 segments are not replicated at all thus not relevant to the 
concept "replica". We are able to track those by unavailable segment gauge 
though. wdyt?



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

Reply via email to