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


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java:
##########
@@ -1200,12 +1219,45 @@ public void trackSegmentForUpsertView(IndexSegment 
segment) {
     if (_upsertViewManager != null) {
       _upsertViewManager.trackSegment(segment);
     }
+    if (segment instanceof MutableSegment) {
+      trackNewlyAddedSegment(segment);
+    }
   }
 
   @Override
   public void untrackSegmentForUpsertView(IndexSegment segment) {
     if (_upsertViewManager != null) {
       _upsertViewManager.untrackSegment(segment);
     }
+    if (segment instanceof MutableSegment) {
+      untrackNewlyAddedSegment(segment);
+    }
+  }
+
+  @VisibleForTesting
+  void trackNewlyAddedSegment(IndexSegment segment) {
+    if (_newSegmentTrackingTimeMs > 0) {
+      _newlyAddedSegments.put(segment.getSegmentName(), -1L);
+    }
+  }
+
+  @VisibleForTesting
+  void untrackNewlyAddedSegment(IndexSegment segment) {

Review Comment:
   I see. Yes, I think broker adds it to routing after it turns ONLINE in EV.
   I still feel it is a misleading calling it untrack but actually track it 
with a timeout. How about calling them `preAddNewSegment()` and 
`postAddNewSegment()`? This is non-blocking comment



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