Forest0923 commented on code in PR #19961: URL: https://github.com/apache/kafka/pull/19961#discussion_r2165273471
########## storage/src/main/java/org/apache/kafka/storage/internals/log/OffsetIndex.java: ########## @@ -95,7 +99,7 @@ public void sanityCheck() { * the pair (baseOffset, 0) is returned. */ public OffsetPosition lookup(long targetOffset) { - return maybeLock(lock, () -> { + return inLock(lock, () -> { Review Comment: I’d like to ask the following questions: 1. The JavaDoc for java.nio.Buffer says it is not thread-safe. In the case of reads, is it still safe for multiple threads to access the same buffer concurrently? (See: https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/nio/Buffer.html) 2. To improve read-operation concurrency, are you suggesting the use of ReentrantReadWriteLock instead of ReentrantLock? -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org