klsince commented on code in PR #12976: URL: https://github.com/apache/pinot/pull/12976#discussion_r1607358605
########## pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java: ########## @@ -1019,34 +1038,106 @@ public synchronized void close() _logger.info("Closed the metadata manager"); } - protected void replaceDocId(ThreadSafeMutableRoaringBitmap validDocIds, + /** + * Use WLock to make updates on two segments' bitmaps atomically. + */ + protected void replaceDocId(IndexSegment newSegment, ThreadSafeMutableRoaringBitmap validDocIds, @Nullable ThreadSafeMutableRoaringBitmap queryableDocIds, IndexSegment oldSegment, int oldDocId, int newDocId, RecordInfo recordInfo) { - removeDocId(oldSegment, oldDocId); - addDocId(validDocIds, queryableDocIds, newDocId, recordInfo); + // For SNAPSHOT consistency mode, we can use RLock here. But for simplicity and considering there is only one Review Comment: kk, separated and commented for more clarity. -- 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