yihua commented on code in PR #8079:
URL: https://github.com/apache/hudi/pull/8079#discussion_r1125389847


##########
hudi-timeline-service/src/main/java/org/apache/hudi/timeline/service/RequestHandler.java:
##########
@@ -151,30 +156,38 @@ public void stop() {
    * Determines if local view of table's timeline is behind that of client's 
view.
    */
   private boolean isLocalViewBehind(Context ctx) {
-    String basePath = 
ctx.queryParam(RemoteHoodieTableFileSystemView.BASEPATH_PARAM);
-    String lastKnownInstantFromClient =
-        ctx.queryParamAsClass(RemoteHoodieTableFileSystemView.LAST_INSTANT_TS, 
String.class).getOrDefault(HoodieTimeline.INVALID_INSTANT_TS);
-    String timelineHashFromClient = 
ctx.queryParamAsClass(RemoteHoodieTableFileSystemView.TIMELINE_HASH, 
String.class).getOrDefault("");
-    HoodieTimeline localTimeline =
-        
viewManager.getFileSystemView(basePath).getTimeline().filterCompletedOrMajorOrMinorCompactionInstants();
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("Client [ LastTs=" + lastKnownInstantFromClient + ", 
TimelineHash=" + timelineHashFromClient
-          + "], localTimeline=" + localTimeline.getInstants());
-    }
+    try {
+      // This read lock makes sure that if the local view of the table is 
being synced,
+      // no timeline server requests should be processed or handled until the 
sync process

Review Comment:
   @danny0405 This is simplified now.  You can also check my updated PR 
description for how the race condition can happen.



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