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/03/16 12:05:15 UTC

[GitHub] [hudi] sekaiga opened a new pull request #5052: [HUDI-3644] hoodie log scan bug cause data duplication bugfix

sekaiga opened a new pull request #5052:
URL: https://github.com/apache/hudi/pull/5052


   ## *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] hudi-bot removed a comment on pull request #5052: [HUDI-3644] hoodie log scan bug cause data duplication bugfix

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "736c3427394d6c8074789c6ad7d9f0521e599a74",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "736c3427394d6c8074789c6ad7d9f0521e599a74",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 736c3427394d6c8074789c6ad7d9f0521e599a74 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 #5052: [HUDI-3644] hoodie log scan bug cause data duplication bugfix

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "736c3427394d6c8074789c6ad7d9f0521e599a74",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6999",
       "triggerID" : "736c3427394d6c8074789c6ad7d9f0521e599a74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ed7918372fdcaca2855d285e17005ecf9cf42520",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7130",
       "triggerID" : "ed7918372fdcaca2855d285e17005ecf9cf42520",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 736c3427394d6c8074789c6ad7d9f0521e599a74 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6999) 
   * ed7918372fdcaca2855d285e17005ecf9cf42520 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7130) 
   
   <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 #5052: [HUDI-3644] hoodie log scan bug cause data duplication bugfix

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "736c3427394d6c8074789c6ad7d9f0521e599a74",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "736c3427394d6c8074789c6ad7d9f0521e599a74",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 736c3427394d6c8074789c6ad7d9f0521e599a74 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 commented on a change in pull request #5052: [HUDI-3644] hoodie log scan bug cause data duplication bugfix

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



##########
File path: hudi-common/src/main/java/org/apache/hudi/common/table/log/AbstractHoodieLogRecordReader.java
##########
@@ -217,16 +215,21 @@ public synchronized void scan(Option<List<String>> keys) {
             && !HoodieTimeline.compareTimestamps(logBlock.getLogBlockHeader().get(INSTANT_TIME), HoodieTimeline.LESSER_THAN_OR_EQUALS, this.latestInstantTime
         )) {
           // hit a block with instant time greater than should be processed, stop processing further
+          LOG.info("hit a block with instant time greater than should be processed, stop processing further. logfile: + " + logFile
+                  + " , blockType: " + logBlock.getBlockType() + " , instantTime: " + instantTime + " , latestInstantTime : " + latestInstantTime  );
           break;
         }
         if (logBlock.getBlockType() != CORRUPT_BLOCK && logBlock.getBlockType() != COMMAND_BLOCK) {
-          if (!completedInstantsTimeline.containsOrBeforeTimelineStarts(instantTime)
-              || inflightInstantsTimeline.containsInstant(instantTime)) {
+            if (!checkIfValidCommit(instantTime) || inflightInstantsTimeline.containsInstant(instantTime)) {

Review comment:
       what exactly are we trying to fix here. can you help explain the scenario. 
   




-- 
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 #5052: [HUDI-3644] hoodie log scan bug cause data duplication bugfix

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "736c3427394d6c8074789c6ad7d9f0521e599a74",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6999",
       "triggerID" : "736c3427394d6c8074789c6ad7d9f0521e599a74",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 736c3427394d6c8074789c6ad7d9f0521e599a74 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6999) 
   
   <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 #5052: [HUDI-3644] hoodie log scan bug cause data duplication bugfix

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "736c3427394d6c8074789c6ad7d9f0521e599a74",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6999",
       "triggerID" : "736c3427394d6c8074789c6ad7d9f0521e599a74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ed7918372fdcaca2855d285e17005ecf9cf42520",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ed7918372fdcaca2855d285e17005ecf9cf42520",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 736c3427394d6c8074789c6ad7d9f0521e599a74 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6999) 
   * ed7918372fdcaca2855d285e17005ecf9cf42520 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 commented on pull request #5052: [HUDI-3644] hoodie log scan bug cause data duplication bugfix

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


   @alexeykudinkin : Can you review this PR. 


-- 
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] sekaiga commented on a change in pull request #5052: [HUDI-3644] hoodie log scan bug cause data duplication bugfix

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



##########
File path: hudi-common/src/main/java/org/apache/hudi/common/table/log/AbstractHoodieLogRecordReader.java
##########
@@ -217,16 +215,21 @@ public synchronized void scan(Option<List<String>> keys) {
             && !HoodieTimeline.compareTimestamps(logBlock.getLogBlockHeader().get(INSTANT_TIME), HoodieTimeline.LESSER_THAN_OR_EQUALS, this.latestInstantTime
         )) {
           // hit a block with instant time greater than should be processed, stop processing further
+          LOG.info("hit a block with instant time greater than should be processed, stop processing further. logfile: + " + logFile
+                  + " , blockType: " + logBlock.getBlockType() + " , instantTime: " + instantTime + " , latestInstantTime : " + latestInstantTime  );
           break;
         }
         if (logBlock.getBlockType() != CORRUPT_BLOCK && logBlock.getBlockType() != COMMAND_BLOCK) {
-          if (!completedInstantsTimeline.containsOrBeforeTimelineStarts(instantTime)
-              || inflightInstantsTimeline.containsInstant(instantTime)) {
+            if (!checkIfValidCommit(instantTime) || inflightInstantsTimeline.containsInstant(instantTime)) {

Review comment:
       im explained in jira :https://issues.apache.org/jira/browse/HUDI-3644
   
   when log file block append sucess.  And deltacommit rollback. And this instance time is before activeTimeline starts. This log file block will be merged, cause data duplication.




-- 
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 #5052: [HUDI-3644] hoodie log scan bug cause data duplication bugfix

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "736c3427394d6c8074789c6ad7d9f0521e599a74",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6999",
       "triggerID" : "736c3427394d6c8074789c6ad7d9f0521e599a74",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 736c3427394d6c8074789c6ad7d9f0521e599a74 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6999) 
   
   <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 #5052: [HUDI-3644] hoodie log scan bug cause data duplication bugfix

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "736c3427394d6c8074789c6ad7d9f0521e599a74",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6999",
       "triggerID" : "736c3427394d6c8074789c6ad7d9f0521e599a74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ed7918372fdcaca2855d285e17005ecf9cf42520",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7130",
       "triggerID" : "ed7918372fdcaca2855d285e17005ecf9cf42520",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 736c3427394d6c8074789c6ad7d9f0521e599a74 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6999) 
   * ed7918372fdcaca2855d285e17005ecf9cf42520 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7130) 
   
   <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 #5052: [HUDI-3644] hoodie log scan bug cause data duplication bugfix

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "736c3427394d6c8074789c6ad7d9f0521e599a74",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6999",
       "triggerID" : "736c3427394d6c8074789c6ad7d9f0521e599a74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ed7918372fdcaca2855d285e17005ecf9cf42520",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7130",
       "triggerID" : "ed7918372fdcaca2855d285e17005ecf9cf42520",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ed7918372fdcaca2855d285e17005ecf9cf42520 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7130) 
   
   <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] sekaiga commented on a change in pull request #5052: [HUDI-3644] hoodie log scan bug cause data duplication bugfix

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



##########
File path: hudi-common/src/main/java/org/apache/hudi/common/table/log/AbstractHoodieLogRecordReader.java
##########
@@ -217,16 +215,21 @@ public synchronized void scan(Option<List<String>> keys) {
             && !HoodieTimeline.compareTimestamps(logBlock.getLogBlockHeader().get(INSTANT_TIME), HoodieTimeline.LESSER_THAN_OR_EQUALS, this.latestInstantTime
         )) {
           // hit a block with instant time greater than should be processed, stop processing further
+          LOG.info("hit a block with instant time greater than should be processed, stop processing further. logfile: + " + logFile
+                  + " , blockType: " + logBlock.getBlockType() + " , instantTime: " + instantTime + " , latestInstantTime : " + latestInstantTime  );
           break;
         }
         if (logBlock.getBlockType() != CORRUPT_BLOCK && logBlock.getBlockType() != COMMAND_BLOCK) {
-          if (!completedInstantsTimeline.containsOrBeforeTimelineStarts(instantTime)
-              || inflightInstantsTimeline.containsInstant(instantTime)) {
+            if (!checkIfValidCommit(instantTime) || inflightInstantsTimeline.containsInstant(instantTime)) {

Review comment:
       sorry,i lost some code when commit, update now




-- 
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 #5052: [HUDI-3644] hoodie log scan bug cause data duplication bugfix

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "736c3427394d6c8074789c6ad7d9f0521e599a74",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6999",
       "triggerID" : "736c3427394d6c8074789c6ad7d9f0521e599a74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ed7918372fdcaca2855d285e17005ecf9cf42520",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ed7918372fdcaca2855d285e17005ecf9cf42520",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 736c3427394d6c8074789c6ad7d9f0521e599a74 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6999) 
   * ed7918372fdcaca2855d285e17005ecf9cf42520 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] alexeykudinkin commented on pull request #5052: [HUDI-3644] hoodie log scan bug cause data duplication bugfix

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


   @sekaiga can you please fill out the description properly? Is this PR still WIP?


-- 
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 #5052: [HUDI-3644] hoodie log scan bug cause data duplication bugfix

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



##########
File path: hudi-common/src/main/java/org/apache/hudi/common/table/log/AbstractHoodieLogRecordReader.java
##########
@@ -217,16 +215,21 @@ public synchronized void scan(Option<List<String>> keys) {
             && !HoodieTimeline.compareTimestamps(logBlock.getLogBlockHeader().get(INSTANT_TIME), HoodieTimeline.LESSER_THAN_OR_EQUALS, this.latestInstantTime
         )) {
           // hit a block with instant time greater than should be processed, stop processing further
+          LOG.info("hit a block with instant time greater than should be processed, stop processing further. logfile: + " + logFile
+                  + " , blockType: " + logBlock.getBlockType() + " , instantTime: " + instantTime + " , latestInstantTime : " + latestInstantTime  );
           break;
         }
         if (logBlock.getBlockType() != CORRUPT_BLOCK && logBlock.getBlockType() != COMMAND_BLOCK) {
-          if (!completedInstantsTimeline.containsOrBeforeTimelineStarts(instantTime)
-              || inflightInstantsTimeline.containsInstant(instantTime)) {
+            if (!checkIfValidCommit(instantTime) || inflightInstantsTimeline.containsInstant(instantTime)) {

Review comment:
       what exactly are we trying to fix here. can you help explain the scenario. 
   




-- 
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] sekaiga commented on a change in pull request #5052: [HUDI-3644] hoodie log scan bug cause data duplication bugfix

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



##########
File path: hudi-common/src/main/java/org/apache/hudi/common/table/log/AbstractHoodieLogRecordReader.java
##########
@@ -217,16 +215,21 @@ public synchronized void scan(Option<List<String>> keys) {
             && !HoodieTimeline.compareTimestamps(logBlock.getLogBlockHeader().get(INSTANT_TIME), HoodieTimeline.LESSER_THAN_OR_EQUALS, this.latestInstantTime
         )) {
           // hit a block with instant time greater than should be processed, stop processing further
+          LOG.info("hit a block with instant time greater than should be processed, stop processing further. logfile: + " + logFile
+                  + " , blockType: " + logBlock.getBlockType() + " , instantTime: " + instantTime + " , latestInstantTime : " + latestInstantTime  );
           break;
         }
         if (logBlock.getBlockType() != CORRUPT_BLOCK && logBlock.getBlockType() != COMMAND_BLOCK) {
-          if (!completedInstantsTimeline.containsOrBeforeTimelineStarts(instantTime)
-              || inflightInstantsTimeline.containsInstant(instantTime)) {
+            if (!checkIfValidCommit(instantTime) || inflightInstantsTimeline.containsInstant(instantTime)) {

Review comment:
       im explained in jira :https://issues.apache.org/jira/browse/HUDI-3644
   
   when log file block append sucess.  And deltacommit rollback. And this instance time is not before activeTimeline starts. This log file block will be merged, cause data duplication.




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