divijvaidya commented on code in PR #13456: URL: https://github.com/apache/kafka/pull/13456#discussion_r1155911890
########## storage/src/main/java/org/apache/kafka/storage/internals/epoch/LeaderEpochFileCache.java: ########## @@ -147,6 +152,16 @@ private List<EpochEntry> removeWhileMatching(Iterator<Map.Entry<Integer, EpochEn return removedEpochs; } + public LeaderEpochFileCache cloneWithLeaderEpochCheckpoint(LeaderEpochCheckpoint leaderEpochCheckpoint) { + lock.readLock().lock(); Review Comment: do we need a read lock here? `epochEntries()` already takes one when required to read the mutable state (`epochs`) that we are trying to protect here. -- 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