9aman commented on code in PR #17163:
URL: https://github.com/apache/pinot/pull/17163#discussion_r2513784291
##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/IngestionDelayTracker.java:
##########
@@ -242,6 +247,11 @@ private void trackIngestionDelay() {
for (Integer partitionId : partitionsHosted) {
_partitionsTracked.computeIfAbsent(partitionId, k -> {
+ // Check below condition in-case partition was stopped being
tracked. Eg: due to manual operations like -
+ // calling remove ingestion metrics API
+ if (!_partitionsHostedByThisServer.containsKey(partitionId) &&
!_ingestionInfoMap.containsKey(partitionId)) {
Review Comment:
Discussed offline, this was added to get rid of the race condition that can
lead to metrics being emitted even for rebalanced partitions.
##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/IngestionDelayTracker.java:
##########
@@ -242,6 +247,11 @@ private void trackIngestionDelay() {
for (Integer partitionId : partitionsHosted) {
_partitionsTracked.computeIfAbsent(partitionId, k -> {
+ // Check below condition in-case partition was stopped being
tracked. Eg: due to manual operations like -
+ // calling remove ingestion metrics API
+ if (!_partitionsHostedByThisServer.containsKey(partitionId) &&
!_ingestionInfoMap.containsKey(partitionId)) {
Review Comment:
@noob-se7en what will happen if
removePartitionId is called and trackIngestionDelay is executed.
_partitionsHostedByThisServer.remove(partitionId);
executes followed by execution of the above line
for (Integer partitionId : partitionsHosted) {
_partitionsTracked.computeIfAbsent(partitionId, k -> {
followed by
_ingestionInfoMap.remove(partitionId);
in that case _ingestionInfoMap will still have the partition right ?
Is the expectation that the next run will clear it ?
What if we switch to the statement suggested by co-pilot ?
--
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]