tbpure opened a new issue, #7484:
URL: https://github.com/apache/paimon/issues/7484

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/paimon/issues) 
and found nothing similar.
   
   
   ### Motivation
   
   In `CachingCatalog`, when multi thread calls the `getTable` with the same 
`Identifier` ,if them all find cache miss, they will call the 
`wrapped.getTable(identifier)` multiple times concurrently, which is very 
expensive. And actually, we just need to call the 
`wrapped.getTable(identifier)` once, and return the result for all calls.
   
   ### Solution
   
   Only allow the first cache-missing thread to call 
`wrapped.getTable(identifier)`. Other concurrent threads requesting the same 
Identifier should wait for and reuse the result. This can be implemented by 
introducing a lock or a Future-based coordination mechanism.
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!


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