J-HowHuang commented on code in PR #19221:
URL: https://github.com/apache/pinot/pull/19221#discussion_r3770791950
##########
pinot-broker/src/main/java/org/apache/pinot/broker/routing/instanceselector/BaseInstanceSelector.java:
##########
@@ -96,17 +105,29 @@ public abstract class BaseInstanceSelector implements
InstanceSelector {
protected InstanceSelectorConfig _config;
protected long _newSegmentExpirationTimeInSeconds;
protected boolean _emitSinglePoolSegmentsMetric;
+ protected boolean _emitReplicaHealthMetrics;
protected int _tableNameHashForFixedReplicaRouting;
+ /// Whether the table is disabled, from the ideal state. A disabled table
has all of its replicas taken
+ /// offline deliberately, so its replica health is not reported at all.
+ protected boolean _tableDisabled;
// These 3 variables are the cached states to help accelerate the change
processing
protected Set<String> _enabledInstances;
// For old segments, all candidates are online
// Reduce this map to reduce garbage
protected final Map<String, List<SegmentInstanceCandidate>>
_oldSegmentCandidatesMap = new HashMap<>();
protected Map<String, NewSegmentState> _newSegmentStateMap;
+ /// Number of ONLINE/CONSUMING instances in the ideal state, for old
segments that have fewer
+ /// candidates than that. Only used for metrics
+ ///
+ /// Kept sparse deliberately: an absent entry means "as many candidates as
the ideal state assigns",
+ /// so a healthy table stores nothing here. Read it through
[#getExpectedReplicas].
+ protected final Map<String, Integer> _oldSegmentExpectedReplicasMap = new
HashMap<>();
Review Comment:
Because the actual percentage would be answered at `refreshSegmentStates`.
Not only EV-IS change triggers it, instance state change (e.g. k8s pod not
ready) also refresh the availability thus percentage. We need to keep track of
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]