You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2021/11/19 03:02:09 UTC

[GitHub] [hudi] manojpec opened a new pull request #4039: [HUDI-2796] Metadata table support for Restore action to first commit

manojpec opened a new pull request #4039:
URL: https://github.com/apache/hudi/pull/4039


   ## What is the purpose of the pull request
   
   *(For example: This pull request adds quick-start document.)*
   
   ## Brief change log
   
   *(for example:)*
     - *Modify AnnotationLocation checkstyle rule in checkstyle.xml*
   
   ## Verify this pull request
   
   *(Please pick either of the following options)*
   
   This pull request is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This pull request is already covered by existing tests, such as *(please describe tests)*.
   
   (or)
   
   This change added tests and can be verified as follows:
   
   *(example:)*
   
     - *Added integration tests for end-to-end.*
     - *Added HoodieClientWriteTest to verify the change.*
     - *Manually verified the change by running a job locally.*
   
   ## Committer checklist
   
    - [ ] Has a corresponding JIRA in PR title & commit
    
    - [ ] Commit message is descriptive of the change
    
    - [ ] CI is green
   
    - [ ] Necessary doc changes done or have another open PR
          
    - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.
   


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



[GitHub] [hudi] hudi-bot removed a comment on pull request #4039: [HUDI-2796] Metadata table support for Restore action to first commit

Posted by GitBox <gi...@apache.org>.
hudi-bot removed a comment on pull request #4039:
URL: https://github.com/apache/hudi/pull/4039#issuecomment-973718291


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3490",
       "triggerID" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "triggerType" : "PUSH"
     }, {
       "hash" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3492",
       "triggerID" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce Azure: [CANCELED](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3490) 
   * 189507629e39393354337a63b752f8a7fecfa5f9 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3492) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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



[GitHub] [hudi] hudi-bot commented on pull request #4039: [HUDI-2796] Metadata table support for Restore action to first commit

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on pull request #4039:
URL: https://github.com/apache/hudi/pull/4039#issuecomment-973718291


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3490",
       "triggerID" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "triggerType" : "PUSH"
     }, {
       "hash" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3492",
       "triggerID" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce Azure: [CANCELED](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3490) 
   * 189507629e39393354337a63b752f8a7fecfa5f9 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3492) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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



[GitHub] [hudi] manojpec commented on a change in pull request #4039: [HUDI-2796] Metadata table support for Restore action to first commit

Posted by GitBox <gi...@apache.org>.
manojpec commented on a change in pull request #4039:
URL: https://github.com/apache/hudi/pull/4039#discussion_r753468212



##########
File path: hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java
##########
@@ -362,10 +352,62 @@ public void initTableMetadata() {
     return false;
   }
 
+  /**
+   * Is the latest commit instant reverted by the in-flight instant action?
+   *
+   * @param actionMetadata                 - In-flight instant action metadata
+   * @param latestMetadataInstantTimestamp - Metadata table latest instant timestamp
+   * @param <T>                            - ActionMetadata type
+   * @return True if the latest instant action is reverted by the action
+   */
+  private <T extends SpecificRecordBase> boolean isCommitRevertedByInFlightAction(Option<T> actionMetadata,
+                                                                                  final String latestMetadataInstantTimestamp) {
+
+    if (!actionMetadata.isPresent()) {
+      return false;
+    }
+
+    final String INSTANT_ACTION = (actionMetadata.get() instanceof HoodieRollbackMetadata
+        ? HoodieTimeline.ROLLBACK_ACTION
+        : (actionMetadata.get() instanceof HoodieRestoreMetadata ? HoodieTimeline.RESTORE_ACTION : ""));
+
+    List<String> affectedInstantTimestamps;
+    switch (INSTANT_ACTION) {
+      case HoodieTimeline.ROLLBACK_ACTION:
+        List<HoodieInstantInfo> rollbackedInstants =
+            ((HoodieRollbackMetadata) actionMetadata.get()).getInstantsRollback();
+        affectedInstantTimestamps = rollbackedInstants.stream().map(instant -> {
+          return instant.getCommitTime().toString();
+        }).collect(Collectors.toList());
+
+        if (affectedInstantTimestamps.contains(latestMetadataInstantTimestamp)) {
+          return true;
+        }
+        break;
+

Review comment:
       fixed.

##########
File path: hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/client/functional/TestHoodieBackedMetadata.java
##########
@@ -361,7 +361,7 @@ public void testRollbackOperations(HoodieTableType tableType) throws Exception {
   @Test
   public void testManualRollbacks() throws Exception {
     HoodieTableType tableType = COPY_ON_WRITE;
-    init(tableType, false);
+    init(tableType, true);

Review comment:
       fixed.

##########
File path: hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/client/functional/TestHoodieBackedMetadata.java
##########
@@ -871,7 +871,7 @@ public void testReader() throws Exception {
    */
   @Test
   public void testCleaningArchivingAndCompaction() throws Exception {
-    init(HoodieTableType.COPY_ON_WRITE, false);
+    init(HoodieTableType.COPY_ON_WRITE, true);

Review comment:
       fixed. 




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



[GitHub] [hudi] hudi-bot commented on pull request #4039: [HUDI-2796] Metadata table support for Restore action to first commit

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on pull request #4039:
URL: https://github.com/apache/hudi/pull/4039#issuecomment-973757250


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3490",
       "triggerID" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "triggerType" : "PUSH"
     }, {
       "hash" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3492",
       "triggerID" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 189507629e39393354337a63b752f8a7fecfa5f9 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3492) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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



[GitHub] [hudi] hudi-bot removed a comment on pull request #4039: [HUDI-2796] Metadata table support for Restore action to first commit

Posted by GitBox <gi...@apache.org>.
hudi-bot removed a comment on pull request #4039:
URL: https://github.com/apache/hudi/pull/4039#issuecomment-973685692


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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



[GitHub] [hudi] hudi-bot commented on pull request #4039: [HUDI-2796] Metadata table support for Restore action to first commit

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on pull request #4039:
URL: https://github.com/apache/hudi/pull/4039#issuecomment-973687979


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3490",
       "triggerID" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "triggerType" : "PUSH"
     }, {
       "hash" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3490) 
   * 189507629e39393354337a63b752f8a7fecfa5f9 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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



[GitHub] [hudi] hudi-bot removed a comment on pull request #4039: [HUDI-2796] Metadata table support for Restore action to first commit

Posted by GitBox <gi...@apache.org>.
hudi-bot removed a comment on pull request #4039:
URL: https://github.com/apache/hudi/pull/4039#issuecomment-973687979


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3490",
       "triggerID" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "triggerType" : "PUSH"
     }, {
       "hash" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3490) 
   * 189507629e39393354337a63b752f8a7fecfa5f9 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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



[GitHub] [hudi] hudi-bot removed a comment on pull request #4039: [HUDI-2796] Metadata table support for Restore action to first commit

Posted by GitBox <gi...@apache.org>.
hudi-bot removed a comment on pull request #4039:
URL: https://github.com/apache/hudi/pull/4039#issuecomment-973690775


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3490",
       "triggerID" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "triggerType" : "PUSH"
     }, {
       "hash" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce Azure: [CANCELED](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3490) 
   * 189507629e39393354337a63b752f8a7fecfa5f9 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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



[GitHub] [hudi] hudi-bot commented on pull request #4039: [HUDI-2796] Metadata table support for Restore action to first commit

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on pull request #4039:
URL: https://github.com/apache/hudi/pull/4039#issuecomment-974359320


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3490",
       "triggerID" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "triggerType" : "PUSH"
     }, {
       "hash" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3492",
       "triggerID" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0bc22b68a753981ad6b0b5ee49ec7f0bc2c23c3b",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0bc22b68a753981ad6b0b5ee49ec7f0bc2c23c3b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 189507629e39393354337a63b752f8a7fecfa5f9 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3492) 
   * 0bc22b68a753981ad6b0b5ee49ec7f0bc2c23c3b UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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



[GitHub] [hudi] hudi-bot commented on pull request #4039: [HUDI-2796] Metadata table support for Restore action to first commit

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on pull request #4039:
URL: https://github.com/apache/hudi/pull/4039#issuecomment-973690775


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3490",
       "triggerID" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "triggerType" : "PUSH"
     }, {
       "hash" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce Azure: [CANCELED](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3490) 
   * 189507629e39393354337a63b752f8a7fecfa5f9 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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



[GitHub] [hudi] nsivabalan merged pull request #4039: [HUDI-2796] Metadata table support for Restore action to first commit

Posted by GitBox <gi...@apache.org>.
nsivabalan merged pull request #4039:
URL: https://github.com/apache/hudi/pull/4039


   


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



[GitHub] [hudi] hudi-bot commented on pull request #4039: [HUDI-2796] Metadata table support for Restore action to first commit

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on pull request #4039:
URL: https://github.com/apache/hudi/pull/4039#issuecomment-973685692


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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



[GitHub] [hudi] hudi-bot removed a comment on pull request #4039: [HUDI-2796] Metadata table support for Restore action to first commit

Posted by GitBox <gi...@apache.org>.
hudi-bot removed a comment on pull request #4039:
URL: https://github.com/apache/hudi/pull/4039#issuecomment-974363362


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3490",
       "triggerID" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "triggerType" : "PUSH"
     }, {
       "hash" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3492",
       "triggerID" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0bc22b68a753981ad6b0b5ee49ec7f0bc2c23c3b",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3515",
       "triggerID" : "0bc22b68a753981ad6b0b5ee49ec7f0bc2c23c3b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 189507629e39393354337a63b752f8a7fecfa5f9 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3492) 
   * 0bc22b68a753981ad6b0b5ee49ec7f0bc2c23c3b Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3515) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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



[GitHub] [hudi] hudi-bot commented on pull request #4039: [HUDI-2796] Metadata table support for Restore action to first commit

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on pull request #4039:
URL: https://github.com/apache/hudi/pull/4039#issuecomment-974363362


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3490",
       "triggerID" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "triggerType" : "PUSH"
     }, {
       "hash" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3492",
       "triggerID" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0bc22b68a753981ad6b0b5ee49ec7f0bc2c23c3b",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3515",
       "triggerID" : "0bc22b68a753981ad6b0b5ee49ec7f0bc2c23c3b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 189507629e39393354337a63b752f8a7fecfa5f9 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3492) 
   * 0bc22b68a753981ad6b0b5ee49ec7f0bc2c23c3b Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3515) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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



[GitHub] [hudi] hudi-bot removed a comment on pull request #4039: [HUDI-2796] Metadata table support for Restore action to first commit

Posted by GitBox <gi...@apache.org>.
hudi-bot removed a comment on pull request #4039:
URL: https://github.com/apache/hudi/pull/4039#issuecomment-974359320


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3490",
       "triggerID" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "triggerType" : "PUSH"
     }, {
       "hash" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3492",
       "triggerID" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0bc22b68a753981ad6b0b5ee49ec7f0bc2c23c3b",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0bc22b68a753981ad6b0b5ee49ec7f0bc2c23c3b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 189507629e39393354337a63b752f8a7fecfa5f9 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3492) 
   * 0bc22b68a753981ad6b0b5ee49ec7f0bc2c23c3b UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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



[GitHub] [hudi] hudi-bot removed a comment on pull request #4039: [HUDI-2796] Metadata table support for Restore action to first commit

Posted by GitBox <gi...@apache.org>.
hudi-bot removed a comment on pull request #4039:
URL: https://github.com/apache/hudi/pull/4039#issuecomment-973757250


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3490",
       "triggerID" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "triggerType" : "PUSH"
     }, {
       "hash" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3492",
       "triggerID" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 189507629e39393354337a63b752f8a7fecfa5f9 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3492) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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



[GitHub] [hudi] nsivabalan commented on a change in pull request #4039: [HUDI-2796] Metadata table support for Restore action to first commit

Posted by GitBox <gi...@apache.org>.
nsivabalan commented on a change in pull request #4039:
URL: https://github.com/apache/hudi/pull/4039#discussion_r753419515



##########
File path: hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java
##########
@@ -362,10 +352,62 @@ public void initTableMetadata() {
     return false;
   }
 
+  /**
+   * Is the latest commit instant reverted by the in-flight instant action?
+   *
+   * @param actionMetadata                 - In-flight instant action metadata
+   * @param latestMetadataInstantTimestamp - Metadata table latest instant timestamp
+   * @param <T>                            - ActionMetadata type
+   * @return True if the latest instant action is reverted by the action
+   */
+  private <T extends SpecificRecordBase> boolean isCommitRevertedByInFlightAction(Option<T> actionMetadata,
+                                                                                  final String latestMetadataInstantTimestamp) {
+
+    if (!actionMetadata.isPresent()) {
+      return false;
+    }
+
+    final String INSTANT_ACTION = (actionMetadata.get() instanceof HoodieRollbackMetadata
+        ? HoodieTimeline.ROLLBACK_ACTION
+        : (actionMetadata.get() instanceof HoodieRestoreMetadata ? HoodieTimeline.RESTORE_ACTION : ""));
+
+    List<String> affectedInstantTimestamps;
+    switch (INSTANT_ACTION) {
+      case HoodieTimeline.ROLLBACK_ACTION:
+        List<HoodieInstantInfo> rollbackedInstants =
+            ((HoodieRollbackMetadata) actionMetadata.get()).getInstantsRollback();
+        affectedInstantTimestamps = rollbackedInstants.stream().map(instant -> {
+          return instant.getCommitTime().toString();
+        }).collect(Collectors.toList());
+
+        if (affectedInstantTimestamps.contains(latestMetadataInstantTimestamp)) {
+          return true;
+        }
+        break;
+

Review comment:
       can you remove unnecessary line breaks in this method

##########
File path: hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/client/functional/TestHoodieBackedMetadata.java
##########
@@ -871,7 +871,7 @@ public void testReader() throws Exception {
    */
   @Test
   public void testCleaningArchivingAndCompaction() throws Exception {
-    init(HoodieTableType.COPY_ON_WRITE, false);
+    init(HoodieTableType.COPY_ON_WRITE, true);

Review comment:
       same here.

##########
File path: hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/client/functional/TestHoodieBackedMetadata.java
##########
@@ -361,7 +361,7 @@ public void testRollbackOperations(HoodieTableType tableType) throws Exception {
   @Test
   public void testManualRollbacks() throws Exception {
     HoodieTableType tableType = COPY_ON_WRITE;
-    init(tableType, false);
+    init(tableType, true);

Review comment:
       why this change? this test intentionally not enabled at the beginning and enables at line 377. 




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



[GitHub] [hudi] hudi-bot commented on pull request #4039: [HUDI-2796] Metadata table support for Restore action to first commit

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on pull request #4039:
URL: https://github.com/apache/hudi/pull/4039#issuecomment-974454605


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3490",
       "triggerID" : "9ae6c15b1dfef4fd12b6de6a93cf744b20fbf3ce",
       "triggerType" : "PUSH"
     }, {
       "hash" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3492",
       "triggerID" : "189507629e39393354337a63b752f8a7fecfa5f9",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0bc22b68a753981ad6b0b5ee49ec7f0bc2c23c3b",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3515",
       "triggerID" : "0bc22b68a753981ad6b0b5ee49ec7f0bc2c23c3b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0bc22b68a753981ad6b0b5ee49ec7f0bc2c23c3b Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3515) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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