Jackie-Jiang commented on code in PR #13668:
URL: https://github.com/apache/pinot/pull/13668#discussion_r1706171311


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/IngestionDelayTracker.java:
##########
@@ -214,7 +230,7 @@ private long getPartitionOffsetLag(IngestionOffsets offset) 
{
    *
    * @param partitionGroupId partition ID which we should stop tracking.
    */
-  private void removePartitionId(int partitionGroupId) {
+  private synchronized void removePartitionId(int partitionGroupId) {

Review Comment:
   To prevent metrics being added back immediately after being removed.
   
   Consider the following sequence:
   1. `updateIngestionMetrics()` checks whether the segment is ignored, and 
passes the check
   2. `stopTrackingPartitionIngestionDelay()` marks the segment to be ignored
   3. `removePartitionId()` removes the metrics
   4. `updateIngestionMetrics()` adds the metrics back
   
   Since all the operations are lightweight, it should be fine to execute them 
sequentially



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to