vinothchandar commented on a change in pull request #3041:
URL: https://github.com/apache/hudi/pull/3041#discussion_r665919857



##########
File path: 
hudi-timeline-service/src/main/java/org/apache/hudi/timeline/service/RequestHandler.java
##########
@@ -132,15 +132,13 @@ private boolean syncIfLocalViewBehind(Context ctx) {
       String lastKnownInstantFromClient =
           ctx.queryParam(RemoteHoodieTableFileSystemView.LAST_INSTANT_TS, 
HoodieTimeline.INVALID_INSTANT_TS);
       SyncableFileSystemView view = viewManager.getFileSystemView(basePath);
-      synchronized (view) {

Review comment:
       I was mulling about the reloading of timeline that happens before the 
write lock. 
   
   ```
   @Override
     public void sync() {
       HoodieTimeline oldTimeline = getTimeline();
       HoodieTimeline newTimeline = 
metaClient.reloadActiveTimeline().filterCompletedAndCompactionInstants();
       try {
         writeLock.lock();
         runSync(oldTimeline, newTimeline);
       } finally {
         writeLock.unlock();
       }
     }
   ```
   
   `runSync()` actually could init/reassign `metaClient`, so in theory removing 
synchornized could in theory make it non-serializable. 
   
   
   I would suggest that we either move the timeline reload into the write lock 
and leave this as-is. Whatever we change, we need to validate with more 
concurrent testing. So not sure if this is all worth the trouble. 
   
   Are you hitting real concurrency bottlenecks around this?




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