xushiyan commented on code in PR #7948:
URL: https://github.com/apache/hudi/pull/7948#discussion_r1106547724


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java:
##########
@@ -839,6 +842,12 @@ private void startCommitWithTime(String instantTime, 
String actionType, HoodieTa
 
   private void startCommit(String instantTime, String actionType, 
HoodieTableMetaClient metaClient) {
     LOG.info("Generate a new instant time: " + instantTime + " action: " + 
actionType);
+    // check there are no inflight restore before starting a new commit.
+    
ValidationUtils.checkArgument(metaClient.getActiveTimeline().getRestoreTimeline().filterInflightsAndRequested().countInstants()
 == 0,
+        "Found pending restore in active timeline. Please complete the restore 
fully before proceeding. As of now, table could be in an inconsistent state. "
+          + "Pending restores: " + 
Arrays.toString(metaClient.getActiveTimeline().getRestoreTimeline()
+          .filterInflightsAndRequested().getInstantsAsStream().map(instant -> 
instant.getTimestamp()).collect(Collectors.toList()).toArray()));

Review Comment:
   
`metaClient.getActiveTimeline().getRestoreTimeline().filterInflightsAndRequested()`
 avoid invoking this twice?



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