neuyilan commented on code in PR #4341: URL: https://github.com/apache/paimon/pull/4341#discussion_r1823713355
########## paimon-core/src/main/java/org/apache/paimon/mergetree/LookupLevels.java: ########## @@ -126,29 +159,37 @@ private T lookup(InternalRow key, SortedRun level) throws IOException { @Nullable private T lookup(InternalRow key, DataFileMeta file) throws IOException { - LookupFile lookupFile = lookupFileCache.getIfPresent(file.fileName()); + ReentrantLock lock = locks[Math.abs(file.hashCode()) % lookupAsyncThreadNumber]; + try { + lock.lock(); + LookupFile lookupFile = lookupFileCache.getIfPresent(file.fileName()); Review Comment: > Can we just create a lock in LookupFile? I think is ok, create one lock in `LookupFile`, the same `DataFileMeta` file use the same lock to ensure thread safe, is that what you mean? -- 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: issues-unsubscr...@paimon.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org