gianm commented on code in PR #19496:
URL: https://github.com/apache/druid/pull/19496#discussion_r3291937123
##########
processing/src/main/java/org/apache/druid/segment/file/PartialSegmentFileMapperV10.java:
##########
@@ -507,6 +517,15 @@ public void initializeContainer(int containerIndex) throws
IOException
* {@link #mapFile} calls for files in this container will re-trigger
downloads via {@link #initializeContainer}
* and the bitmap will be repopulated incrementally.
* <p>
+ * <b>Concurrency contract.</b> The caller is responsible for ensuring no
concurrent {@link #mapFile} (or
+ * {@link #ensureFilesAvailable}) call is in flight for any file in this
container. This is enforced one layer up
+ * by the cache-entry refcount: {@code PartialSegmentBundleCacheEntry} only
invokes {@code evictContainer} from its
+ * {@code doActualUnmount} callback, which fires only after every reference
acquired via
+ * {@code acquireReference()} has been closed. Bypassing that gate is
dangerous — {@link ByteBufferUtils#unmap}
Review Comment:
I am approving this PR but wouldn't mind if this comment was tidied up a bit
prior to merge. It's a bit verbose.
--
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]