[HUDI-4311] Fix Flink lose data on some rollback scene (#5950)
This commit is contained in:
@@ -271,7 +271,7 @@ public class StreamWriteOperatorCoordinator
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void notifyCheckpointAborted(long checkpointId) {
|
public void notifyCheckpointAborted(long checkpointId) {
|
||||||
if (checkpointId == this.checkpointId) {
|
if (checkpointId == this.checkpointId && !WriteMetadataEvent.BOOTSTRAP_INSTANT.equals(this.instant)) {
|
||||||
executor.execute(() -> {
|
executor.execute(() -> {
|
||||||
this.ckpMetadata.abortInstant(this.instant);
|
this.ckpMetadata.abortInstant(this.instant);
|
||||||
}, "abort instant %s", this.instant);
|
}, "abort instant %s", this.instant);
|
||||||
|
|||||||
@@ -97,8 +97,6 @@ public class CkpMetadata implements Serializable {
|
|||||||
public void bootstrap(HoodieTableMetaClient metaClient) throws IOException {
|
public void bootstrap(HoodieTableMetaClient metaClient) throws IOException {
|
||||||
fs.delete(path, true);
|
fs.delete(path, true);
|
||||||
fs.mkdirs(path);
|
fs.mkdirs(path);
|
||||||
metaClient.getActiveTimeline().getCommitsTimeline().filterPendingExcludingCompaction()
|
|
||||||
.lastInstant().ifPresent(instant -> startInstant(instant.getTimestamp()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startInstant(String instant) {
|
public void startInstant(String instant) {
|
||||||
|
|||||||
Reference in New Issue
Block a user