noob-se7en commented on code in PR #16657:
URL: https://github.com/apache/pinot/pull/16657#discussion_r2301348121


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeTableDataManager.java:
##########
@@ -335,6 +335,18 @@ public void onConsumingToDropped(String segmentName) {
     _ingestionDelayTracker.stopTrackingPartitionIngestionDelay(new 
LLCSegmentName(segmentName).getPartitionGroupId());
   }
 
+  /**
+   * Method to handle CONSUMING -> OFFLINE segment state transitions:
+   * We must stop tracking partitions for ingestion-delay if consuming segment 
is marked as offline as there won't be
+   * any consumer present on the server for the partition segment is consuming 
from.
+   *
+   * @param segmentName name of segment which is transitioning state.
+   */
+  @Override
+  public void onConsumingToOffline(String segmentName) {
+    _ingestionDelayTracker.stopTrackingPartitionIngestionDelay(new 
LLCSegmentName(segmentName).getPartitionGroupId());
+  }
+

Review Comment:
   > Can you include the comments I made for queries in this PR: 
https://github.com/apache/pinot/pull/16684
   Done
   
   > Also let's use segment name instead of partition id to ensure the 
_segmentsToIgnore is updated
   This will create bug right? If same segment which went offline is again 
changed to consuming by say RVM job then consuming metrics wont be emitted.



##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeTableDataManager.java:
##########
@@ -335,6 +335,18 @@ public void onConsumingToDropped(String segmentName) {
     _ingestionDelayTracker.stopTrackingPartitionIngestionDelay(new 
LLCSegmentName(segmentName).getPartitionGroupId());
   }
 
+  /**
+   * Method to handle CONSUMING -> OFFLINE segment state transitions:
+   * We must stop tracking partitions for ingestion-delay if consuming segment 
is marked as offline as there won't be
+   * any consumer present on the server for the partition segment is consuming 
from.
+   *
+   * @param segmentName name of segment which is transitioning state.
+   */
+  @Override
+  public void onConsumingToOffline(String segmentName) {
+    _ingestionDelayTracker.stopTrackingPartitionIngestionDelay(new 
LLCSegmentName(segmentName).getPartitionGroupId());
+  }
+

Review Comment:
   > Can you include the comments I made for queries in this PR: 
https://github.com/apache/pinot/pull/16684
   
   Done
   
   > Also let's use segment name instead of partition id to ensure the 
_segmentsToIgnore is updated
   
   This will create bug right? If same segment which went offline is again 
changed to consuming by say RVM job then consuming metrics wont be emitted I 
believe.



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