dongkelun commented on code in PR #5478:
URL: https://github.com/apache/hudi/pull/5478#discussion_r964285634


##########
hudi-timeline-service/src/main/java/org/apache/hudi/timeline/service/RequestHandler.java:
##########
@@ -502,14 +502,20 @@ public void handle(@NotNull Context context) throws 
Exception {
         if (refreshCheck) {
           long beginFinalCheck = System.currentTimeMillis();
           if (isLocalViewBehind(context)) {
-            String errMsg =
-                "Last known instant from client was "
-                    + 
context.queryParam(RemoteHoodieTableFileSystemView.LAST_INSTANT_TS,
-                        HoodieTimeline.INVALID_INSTANT_TS)
-                    + " but server has the following timeline "
-                    + 
viewManager.getFileSystemView(context.queryParam(RemoteHoodieTableFileSystemView.BASEPATH_PARAM))
-                        
.getTimeline().getInstants().collect(Collectors.toList());
-            throw new BadRequestResponse(errMsg);
+            String lastInstantTs = 
context.queryParam(RemoteHoodieTableFileSystemView.LAST_INSTANT_TS,
+                HoodieTimeline.INVALID_INSTANT_TS);
+            HoodieTimeline localTimeline =
+                
viewManager.getFileSystemView(context.queryParam(RemoteHoodieTableFileSystemView.BASEPATH_PARAM)).getTimeline();
+            HoodieTimeline afterLastInstantTimeLine = 
localTimeline.findInstantsAfter(lastInstantTs).filterCompletedInstants();
+            if (!(afterLastInstantTimeLine.countInstants() == 1

Review Comment:
   `syncIfLocalViewBehind` is triggered before this. This judgment is added 
here mainly to avoid throwing exceptions during asynchronous clean, otherwise 
the program cannot execute normally.
   
   I will try to move it to a separate method



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to