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 2022/05/26 02:40:13 UTC

[GitHub] [hudi] watermelon12138 opened a new pull request, #5688: [HUDI-4157] fix Problem that IllegalArgumentException is thrown when the rollback is executed for a completed commit.

watermelon12138 opened a new pull request, #5688:
URL: https://github.com/apache/hudi/pull/5688

   …the rollback is executed for a completed commit.
   
   ## *Tips*
   - *Thank you very much for contributing to Apache Hudi.*
   - *Please review https://hudi.apache.org/contribute/how-to-contribute before opening a pull request.*
   
   ## 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] xushiyan commented on a diff in pull request #5688: [HUDI-4157] fix Problem that IllegalArgumentException is thrown when the rollback is executed for a completed commit.

Posted by GitBox <gi...@apache.org>.
xushiyan commented on code in PR #5688:
URL: https://github.com/apache/hudi/pull/5688#discussion_r882631780


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/rollback/BaseRollbackActionExecutor.java:
##########
@@ -88,11 +88,11 @@ public BaseRollbackActionExecutor(HoodieEngineContext context,
     this.resolvedInstant = instantToRollback;
     this.deleteInstants = deleteInstants;
     this.skipTimelinePublish = skipTimelinePublish;
-    this.useMarkerBasedStrategy = useMarkerBasedStrategy;
-    if (useMarkerBasedStrategy) {
-      ValidationUtils.checkArgument(!instantToRollback.isCompleted(),
-          "Cannot use marker based rollback strategy on completed instant:" + instantToRollback);
+    if (instantToRollback.isCompleted() && useMarkerBasedStrategy) {
+      useMarkerBasedStrategy = false;
+      LOG.warn("Cannot use marker based rollback strategy on completed instant:" + instantToRollback + ", the strategy has been automatically disabled.");

Review Comment:
   @watermelon12138 this does not look like a bug, can you change the jira type from bug to improvement? And let's hold off this PR before @yihua confirms on the validation scenario.



##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/rollback/BaseRollbackActionExecutor.java:
##########
@@ -88,11 +88,11 @@ public BaseRollbackActionExecutor(HoodieEngineContext context,
     this.resolvedInstant = instantToRollback;
     this.deleteInstants = deleteInstants;
     this.skipTimelinePublish = skipTimelinePublish;
-    this.useMarkerBasedStrategy = useMarkerBasedStrategy;
-    if (useMarkerBasedStrategy) {
-      ValidationUtils.checkArgument(!instantToRollback.isCompleted(),
-          "Cannot use marker based rollback strategy on completed instant:" + instantToRollback);
+    if (instantToRollback.isCompleted() && useMarkerBasedStrategy) {
+      useMarkerBasedStrategy = false;
+      LOG.warn("Cannot use marker based rollback strategy on completed instant:" + instantToRollback + ", the strategy has been automatically disabled.");

Review Comment:
   this is a behavior change. @yihua do you know why this validation in the first place?



-- 
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 #5688: [HUDI-4157] fix Problem that IllegalArgumentException is thrown when the rollback is executed for a completed commit.

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "fa54c98bc27837b31de301152b8043455337b917",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8935",
       "triggerID" : "fa54c98bc27837b31de301152b8043455337b917",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * fa54c98bc27837b31de301152b8043455337b917 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8935) 
   
   <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] yihua commented on a diff in pull request #5688: [HUDI-4157] fix Problem that IllegalArgumentException is thrown when the rollback is executed for a completed commit.

Posted by GitBox <gi...@apache.org>.
yihua commented on code in PR #5688:
URL: https://github.com/apache/hudi/pull/5688#discussion_r883395786


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/rollback/BaseRollbackActionExecutor.java:
##########
@@ -88,11 +88,11 @@ public BaseRollbackActionExecutor(HoodieEngineContext context,
     this.resolvedInstant = instantToRollback;
     this.deleteInstants = deleteInstants;
     this.skipTimelinePublish = skipTimelinePublish;
-    this.useMarkerBasedStrategy = useMarkerBasedStrategy;
-    if (useMarkerBasedStrategy) {
-      ValidationUtils.checkArgument(!instantToRollback.isCompleted(),
-          "Cannot use marker based rollback strategy on completed instant:" + instantToRollback);
+    if (instantToRollback.isCompleted() && useMarkerBasedStrategy) {
+      useMarkerBasedStrategy = false;
+      LOG.warn("Cannot use marker based rollback strategy on completed instant:" + instantToRollback + ", the strategy has been automatically disabled.");

Review Comment:
   The validation is required because the marker-based rollback cannot be applied to a complete instant since there is no marker for complete instants.
   
   Instead of fixing the logic here to hide the anti-usage pattern, the caller of `BaseRollbackActionExecutor` should make sure that marker-based rollback is not used for completed instants.  @watermelon12138 could you clarify which UTs are relevant and why we need the fix here?



-- 
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 #5688: [HUDI-4157] fix Problem that IllegalArgumentException is thrown when the rollback is executed for a completed commit.

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "fa54c98bc27837b31de301152b8043455337b917",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8935",
       "triggerID" : "fa54c98bc27837b31de301152b8043455337b917",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * fa54c98bc27837b31de301152b8043455337b917 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8935) 
   
   <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] xushiyan commented on a diff in pull request #5688: [HUDI-4157] fix Problem that IllegalArgumentException is thrown when the rollback is executed for a completed commit.

Posted by GitBox <gi...@apache.org>.
xushiyan commented on code in PR #5688:
URL: https://github.com/apache/hudi/pull/5688#discussion_r883412310


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/rollback/BaseRollbackActionExecutor.java:
##########
@@ -88,11 +88,11 @@ public BaseRollbackActionExecutor(HoodieEngineContext context,
     this.resolvedInstant = instantToRollback;
     this.deleteInstants = deleteInstants;
     this.skipTimelinePublish = skipTimelinePublish;
-    this.useMarkerBasedStrategy = useMarkerBasedStrategy;
-    if (useMarkerBasedStrategy) {
-      ValidationUtils.checkArgument(!instantToRollback.isCompleted(),
-          "Cannot use marker based rollback strategy on completed instant:" + instantToRollback);
+    if (instantToRollback.isCompleted() && useMarkerBasedStrategy) {
+      useMarkerBasedStrategy = false;
+      LOG.warn("Cannot use marker based rollback strategy on completed instant:" + instantToRollback + ", the strategy has been automatically disabled.");

Review Comment:
   Ok this means we should not make this change here; it is against the original design.



-- 
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] xushiyan closed pull request #5688: [HUDI-4157] fix Problem that IllegalArgumentException is thrown when the rollback is executed for a completed commit.

Posted by GitBox <gi...@apache.org>.
xushiyan closed pull request #5688: [HUDI-4157] fix Problem that IllegalArgumentException is thrown when the rollback is executed for a completed commit.
URL: https://github.com/apache/hudi/pull/5688


-- 
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 #5688: [HUDI-4157] fix Problem that IllegalArgumentException is thrown when the rollback is executed for a completed commit.

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "fa54c98bc27837b31de301152b8043455337b917",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "fa54c98bc27837b31de301152b8043455337b917",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * fa54c98bc27837b31de301152b8043455337b917 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] watermelon12138 commented on a diff in pull request #5688: [HUDI-4157] fix Problem that IllegalArgumentException is thrown when the rollback is executed for a completed commit.

Posted by GitBox <gi...@apache.org>.
watermelon12138 commented on code in PR #5688:
URL: https://github.com/apache/hudi/pull/5688#discussion_r883310409


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/rollback/BaseRollbackActionExecutor.java:
##########
@@ -88,11 +88,11 @@ public BaseRollbackActionExecutor(HoodieEngineContext context,
     this.resolvedInstant = instantToRollback;
     this.deleteInstants = deleteInstants;
     this.skipTimelinePublish = skipTimelinePublish;
-    this.useMarkerBasedStrategy = useMarkerBasedStrategy;
-    if (useMarkerBasedStrategy) {
-      ValidationUtils.checkArgument(!instantToRollback.isCompleted(),
-          "Cannot use marker based rollback strategy on completed instant:" + instantToRollback);
+    if (instantToRollback.isCompleted() && useMarkerBasedStrategy) {
+      useMarkerBasedStrategy = false;
+      LOG.warn("Cannot use marker based rollback strategy on completed instant:" + instantToRollback + ", the strategy has been automatically disabled.");

Review Comment:
   @xushiyan @yihua ok,i see. I have changed the jira type from bug to improvement. And the reason why CI fail is that some uts expect IllegalArgumentException during the rollback of the completed commit. Is that normal? why can't we just roll back completed instant?



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