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 2023/01/07 05:35:18 UTC

[GitHub] [hudi] danny0405 opened a new pull request, #7620: [HUDI-5511] Do not clean the CkpMetadata dir when restart the job

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

   At the beginning, we bootstrap the ckp metadata by cleaning all the messages. This brings in some corner case like 'the write task can not fetch the pending instant correctly when restartting the job', if a checkpoint succeed and the job crashes suddenly, the instant hasn't had time to commit, then the data loss happens, because the last pending instant would be rolled back, while the Flink engin thinks the checkpint/instant is successful.
   
   Q: Why we clean the messages here ?
   A: To prevent inconsistencies between timeline and the messages.
   
   Q: Why we decide to keep the messages ?
   A: There are two cases for the inconsistency:
   
   1. the timeline instant is complete but the ckp message is inflight (for committing instant);
   2. the timeline instant is pending while the ckp message does not start (for starting a new instant);
   
   For case1, there is no need to re-commit the instant, so it's okey the write task does not get any pending instant when recovering, for case2, the instant is basically pending, it would be rolled back which is in line with expectations. so keeping the ckp messages as is can actually maintain correctness.
   
   ### Change Logs
   
   Keep the ckp messages instead of cleaning it.
   
   ### Impact
   
   No impact
   
   ### Risk level (write none, low medium or high below)
   
   none
   
   ### Documentation Update
   
   _Describe any necessary documentation update if there is any new feature, config, or user-facing change_
   
   - _The config description must be updated if new configs are added or the default value of the configs are changed_
   - _Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the
     ticket number here and follow the [instruction](https://hudi.apache.org/contribute/developer-setup#website) to make
     changes to the website._
   
   ### Contributor's checklist
   
   - [ ] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [ ] Change Logs and Impact were stated clearly
   - [ ] Adequate tests were added if applicable
   - [ ] CI passed
   


-- 
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] SteNicholas commented on a diff in pull request #7620: [HUDI-5511] Do not clean the CkpMetadata dir when restart the job

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


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/meta/CkpMetadata.java:
##########
@@ -92,13 +92,14 @@ public void close() {
   // -------------------------------------------------------------------------
 
   /**
-   * Initialize the message bus, would clean all the messages
+   * Initialize the message bus, would keep all the messages.
    *
    * <p>This expects to be called by the driver.
    */
   public void bootstrap() throws IOException {
-    fs.delete(path, true);
-    fs.mkdirs(path);
+    if (!fs.exists(path)) {

Review Comment:
   If a checkpoint succeed and the job crashes suddenly, meanwhile the JM restarts on another machine instance, the ckp metadata isn't keeped. This change only solves the scenario where JM is on the same machine. WDYT?



-- 
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] SteNicholas commented on a diff in pull request #7620: [HUDI-5511] Do not clean the CkpMetadata dir when restart the job

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


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/meta/CkpMetadata.java:
##########
@@ -92,13 +92,14 @@ public void close() {
   // -------------------------------------------------------------------------
 
   /**
-   * Initialize the message bus, would clean all the messages
+   * Initialize the message bus, would keep all the messages.
    *
    * <p>This expects to be called by the driver.
    */
   public void bootstrap() throws IOException {
-    fs.delete(path, true);
-    fs.mkdirs(path);
+    if (!fs.exists(path)) {

Review Comment:
   If a checkpoint succeed and the job crashes suddenly, meanwhile the JM restarts on another machine instance, the ckp metadata isn't keeped. This change only solves the scenario where JM is on the same machine. WDYT?



-- 
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] danny0405 merged pull request #7620: [HUDI-5511] Do not clean the CkpMetadata dir when restart the job

Posted by GitBox <gi...@apache.org>.
danny0405 merged PR #7620:
URL: https://github.com/apache/hudi/pull/7620


-- 
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 #7620: [HUDI-5511] Do not clean the CkpMetadata dir when restart the job

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "cd670233392323f8602950a5d2595661b668f3e9",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=14161",
       "triggerID" : "cd670233392323f8602950a5d2595661b668f3e9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * cd670233392323f8602950a5d2595661b668f3e9 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=14161) 
   
   <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 #7620: [HUDI-5511] Do not clean the CkpMetadata dir when restart the job

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "cd670233392323f8602950a5d2595661b668f3e9",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=14161",
       "triggerID" : "cd670233392323f8602950a5d2595661b668f3e9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * cd670233392323f8602950a5d2595661b668f3e9 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=14161) 
   
   <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 #7620: [HUDI-5511] Do not clean the CkpMetadata dir when restart the job

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "cd670233392323f8602950a5d2595661b668f3e9",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "cd670233392323f8602950a5d2595661b668f3e9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * cd670233392323f8602950a5d2595661b668f3e9 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