klsince commented on code in PR #13992: URL: https://github.com/apache/pinot/pull/13992#discussion_r1761853000
########## 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 left comment for `_newlyAddedSegments` variable, that the delay timer starts after the segment is fully processed, as the time to add a segment can vary a lot. and similar comment added for the new config ``` @JsonPropertyDescription("How long to track a newly added segment, after it is processed by the server.") private long _newSegmentTrackingTimeMs = 30000; ``` lemme know if these make sense. -- 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