xiangfu0 commented on code in PR #19730:
URL: https://github.com/apache/pinot/pull/19730#discussion_r4278297509
##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/IngestionDelayTracker.java:
##########
@@ -508,6 +510,23 @@ public void timeoutInactivePartitions() {
_partitionsHostedByThisServer = newMap;
}
+ /// Removes the LLC_PARTITION_CONSUMING gauge of a partition this server no
longer consumes (e.g. an ended Kinesis
+ /// shard), so that it does not stay at 0 forever. The gauge is keyed by
client id, not by partition id.
+ private void removeConsumingGauge(int partitionId) {
+ try {
+ TableConfig tableConfig =
_realTimeTableDataManager.getCachedTableConfigAndSchema().getLeft();
Review Comment:
**MINOR.** Worth a one-line comment here: this rebuilds the gauge key from
the *current* cached table config, while the gauge was registered from the
config the segment manager had at creation time. If the stream topic name (or
the single↔multi-stream layout) changed in between, the rebuilt clientId won't
match and `removeTableGauge` is a silent no-op — so the key must correspond to
the config used at registration. It's a narrow operational edge (live topic
rename / stream-count change), just worth noting.
##########
pinot-core/src/test/java/org/apache/pinot/core/data/manager/realtime/IngestionDelayTrackerTest.java:
##########
@@ -354,6 +358,34 @@ public void testStopTrackingIngestionDelay() {
}
}
+ @Test
+ public void testTimeoutInactivePartitionsRemovesConsumingGauge() {
Review Comment:
**MINOR — coverage.** This exercises only the single-stream,
small-partition-id case, where the stream-partition-id mapping returns 0
whether or not the `% 10000` translation is applied. A multi-stream case (e.g.
partition `10003`) would also exercise the `streamConfigIndex`/topic-index
selection and the partition-id>10000 encoding in `removeConsumingGauge`, which
is where a key-mismatch regression would actually show up. Nice that the
assertions match the exact clientId key though — not vacuous.
--
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]