You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "xushiyan (via GitHub)" <gi...@apache.org> on 2023/02/15 01:16:55 UTC

[GitHub] [hudi] xushiyan commented on a diff in pull request #7948: [HUDI-5794] Failing new commits on any pending restore commits

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

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