-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HUDI-4311] Fix Flink lose data on some rollback scene #5950
Changes from 5 commits
d25cf6e
5f81f39
237c256
6099161
1b1334c
3e8a36c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,8 +97,6 @@ public void close() { | |
public void bootstrap(HoodieTableMetaClient metaClient) throws IOException { | ||
fs.delete(path, true); | ||
fs.mkdirs(path); | ||
metaClient.getActiveTimeline().getCommitsTimeline().filterPendingExcludingCompaction() | ||
.lastInstant().ifPresent(instant -> startInstant(instant.getTimestamp())); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if we remove the logic of start last pending instant, how can we recommit the inflight commit? cc @wxplovecc @danny0405 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would rollback it first before starting a new one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @danny0405 When flink checkpoint complete but hudi commit failed, we need recommit the commit, rollback the inflight commit will lose data, any new logic to guard this case? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
|
||
public void startInstant(String instant) { | ||
|
@@ -154,7 +152,9 @@ public void commitInstant(String instant) { | |
public void abortInstant(String instant) { | ||
Path path = fullPath(CkpMessage.getFileName(instant, CkpMessage.State.ABORTED)); | ||
try { | ||
fs.createNewFile(path); | ||
if (fs.exists(fullPath(CkpMessage.getFileName(instant, CkpMessage.State.INFLIGHT)))) { | ||
fs.createNewFile(path); | ||
} | ||
} catch (IOException e) { | ||
throw new HoodieException("Exception while adding checkpoint abort metadata for instant: " + instant); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we roll back this change now, not sure if it is right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In
StreamWriteOperatorCoordinator#notifyCheckpointAborted
,we can add another check condition:
checkpointId == this.checkpointId && !WriteMetadataEvent.BOOTSTRAP_INSTANT.equals(this.instant)
to make sure not abort the instant during first time startup for rollback