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



##########
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:
       Thanks a lot for reply.  Do you mean the  `synchornized `  is to ensure  
`HoodieTimeline newTimeline = 
metaClient.reloadActiveTimeline().filterCompletedAndCompactionInstants();`  
concurrently?
   
   In fact, we are also to do this right ?
   
   ```
   @Override
     public void sync() {
       HoodieTimeline oldTimeline = getTimeline();
       try {
         writeLock.lock();
         HoodieTimeline newTimeline = 
metaClient.reloadActiveTimeline().filterCompletedAndCompactionInstants();
         runSync(oldTimeline, newTimeline);
       } finally {
         writeLock.unlock();
       }
     }
   ```
   
   I am confused when I see the code that we use  `synchornized`  and  
`writeLock`  at the same time.
   
   I agree to validate this with more concurrent testing. Currently i have not 
encountered  concurrency bottlenecks. 
   




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