prashantwason commented on a change in pull request #2494:
URL: https://github.com/apache/hudi/pull/2494#discussion_r578805191
##########
File path:
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadata.java
##########
@@ -112,13 +113,59 @@ private void initIfNeeded() {
@Override
protected Option<HoodieRecord<HoodieMetadataPayload>>
getRecordByKeyFromMetadata(String key) {
+ // This function can be called in parallel through multiple threads. For
each thread, we determine the thread-local
+ // versions of the baseFile and logRecord readers to use.
+ // - If reuse is enabled, we use the same readers and dont close them
+ // - if reuse is disabled, we open new readers in each thread and close
them
+ HoodieFileReader localFileReader = null;
+ HoodieMetadataMergedLogRecordScanner localLogRecordScanner = null;
+ synchronized (this) {
Review comment:
The only function called from within this synchronized block of code is
the openReaders which itself is not synchronized.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]