Stephen0421 opened a new pull request, #8356:
URL: https://github.com/apache/paimon/pull/8356

   ### Purpose
   
   This PR makes local table lookup safer for concurrent access.
   
   `LocalTableQuery` previously synchronized the whole `lookup` method. This PR 
replaces the coarse-grained query-level synchronization with bucket-level state 
and read/write locking, so `lookup()` and `refreshFiles()` have explicit 
concurrency semantics per bucket.
   
   It also hardens lookup file lifecycle handling:
   
   - Make `LookupFile` access and close idempotent/thread-safe.
   - Serialize lookup file creation per data file to avoid duplicate local 
lookup file creation.
   - Synchronize shared key serializer and persist processor usage.
   - Ensure local lookup files are cleaned when `LookupFile.close` or 
`LookupLevels.createLookupFile` fails on checked or unchecked exceptions.
   
   This is intended as correctness groundwork for concurrent local lookup 
usage, rather than a standalone throughput benchmark change.
   
   ### Tests
   
   Added tests:
   
   - `LookupFileTest#testCloseCleansLocalStateWhenReaderCloseFails`
   - `LookupLevelsTest#testCreateReaderRuntimeFailureCleansLocalFile`
   - Additional lookup concurrency / table query coverage in `LookupLevelsTest` 
and `PrimaryKeySimpleTableTest`
   
   Verified by:
   
   - `mvn -pl paimon-core -Pfast-build -Dtest=LookupFileTest,LookupLevelsTest 
test`
   - `mvn -pl paimon-core -Pfast-build 
-Dtest=PrimaryKeySimpleTableTest#testTableQueryForLookup+testTableQueryForLookupLocalSortFile+testTableQueryForNormal+testTableQueryDownloadsRemoteLookupFile
 test`


-- 
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]

Reply via email to