Skip to content

Conversation

@danny0405
Copy link
Contributor

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 to make
    changes to the website.

Contributor's checklist

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

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.
@hudi-bot
Copy link
Collaborator

hudi-bot commented Jan 7, 2023

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

Copy link
Contributor

@XuQianJin-Stars XuQianJin-Stars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reorganized, doubts resolved.

@XuQianJin-Stars XuQianJin-Stars self-requested a review January 8, 2023 09:43
@danny0405 danny0405 merged commit ff403c8 into apache:master Jan 9, 2023
fengjian428 pushed a commit to fengjian428/hudi that referenced this pull request Jan 31, 2023
…ache#7620)

In the beginning, we bootstrap the ckp metadata by cleaning all the messages.
This introduces some corner case like 'the write task cannot fetch the pending instant correctly when restarting the job',
if a checkpoint succeeds 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 engine thinks the checkpoint/instant is successful.

Q: Why we clean the messages?
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.
Keeping the ckp messages as it is can actually preserve correctness.
XuQianJin-Stars pushed a commit that referenced this pull request Jan 31, 2023
)

In the beginning, we bootstrap the ckp metadata by cleaning all the messages.
This introduces some corner case like 'the write task cannot fetch the pending instant correctly when restarting the job',
if a checkpoint succeeds 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 engine thinks the checkpoint/instant is successful.

Q: Why we clean the messages?
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.
Keeping the ckp messages as it is can actually preserve correctness.

(cherry picked from commit ff403c8)
nsivabalan pushed a commit to nsivabalan/hudi that referenced this pull request Mar 22, 2023
…ache#7620)

In the beginning, we bootstrap the ckp metadata by cleaning all the messages.
This introduces some corner case like 'the write task cannot fetch the pending instant correctly when restarting the job',
if a checkpoint succeeds 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 engine thinks the checkpoint/instant is successful.

Q: Why we clean the messages?
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.
Keeping the ckp messages as it is can actually preserve correctness.
danny0405 added a commit that referenced this pull request Apr 5, 2023
We received several bug reports since #7620, for example: #8060, this patch revert the changes of CkpMetadata and always report the write metadata events for write task, the coordinator would decide whether to re-commit these metadata stats.
fengjian428 pushed a commit to fengjian428/hudi that referenced this pull request Apr 5, 2023
…ache#7620)

In the beginning, we bootstrap the ckp metadata by cleaning all the messages.
This introduces some corner case like 'the write task cannot fetch the pending instant correctly when restarting the job',
if a checkpoint succeeds 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 engine thinks the checkpoint/instant is successful.

Q: Why we clean the messages?
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.
Keeping the ckp messages as it is can actually preserve correctness.
nsivabalan pushed a commit that referenced this pull request Apr 7, 2023
We received several bug reports since #7620, for example: #8060, this patch revert the changes of CkpMetadata and always report the write metadata events for write task, the coordinator would decide whether to re-commit these metadata stats.
h1ap pushed a commit to h1ap/hudi that referenced this pull request Apr 12, 2023
We received several bug reports since apache#7620, for example: apache#8060, this patch revert the changes of CkpMetadata and always report the write metadata events for write task, the coordinator would decide whether to re-commit these metadata stats.
# Conflicts:
#	hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/sink/meta/TestCkpMetadata.java
stayrascal pushed a commit to stayrascal/hudi that referenced this pull request Apr 20, 2023
We received several bug reports since apache#7620, for example: apache#8060, this patch revert the changes of CkpMetadata and always report the write metadata events for write task, the coordinator would decide whether to re-commit these metadata stats.
yihua pushed a commit to yihua/hudi that referenced this pull request May 15, 2023
We received several bug reports since apache#7620, for example: apache#8060, this patch revert the changes of CkpMetadata and always report the write metadata events for write task, the coordinator would decide whether to re-commit these metadata stats.
KnightChess pushed a commit to KnightChess/hudi that referenced this pull request Jan 2, 2024
We received several bug reports since apache#7620, for example: apache#8060, this patch revert the changes of CkpMetadata and always report the write metadata events for write task, the coordinator would decide whether to re-commit these metadata stats.

Signed-off-by: liangjunning <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants