Skip to content

Commit

Permalink
rollback task failed scene
Browse files Browse the repository at this point in the history
  • Loading branch information
wxplovecc committed Jun 27, 2022
1 parent 1b1334c commit 3e8a36c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
Expand Down Expand Up @@ -266,7 +265,7 @@ public void notifyCheckpointComplete(long checkpointId) {

@Override
public void notifyCheckpointAborted(long checkpointId) {
if (checkpointId == this.checkpointId) {
if (checkpointId == this.checkpointId && !WriteMetadataEvent.BOOTSTRAP_INSTANT.equals(this.instant)) {
executor.execute(() -> {
this.ckpMetadata.abortInstant(this.instant);
}, "abort instant %s", this.instant);
Expand Down Expand Up @@ -306,13 +305,6 @@ public void subtaskFailed(int i, @Nullable Throwable throwable) {
// reset the event
this.eventBuffer[i] = null;
LOG.warn("Reset the event for task [" + i + "]", throwable);
if (Arrays.stream(this.eventBuffer).allMatch(event -> event == null)) {
try {
this.ckpMetadata.bootstrap(this.metaClient);
} catch (IOException e) {
throw new HoodieException("Bootstrap ckpMetadata exception", e);
}
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,7 @@ public void commitInstant(String instant) {
public void abortInstant(String instant) {
Path path = fullPath(CkpMessage.getFileName(instant, CkpMessage.State.ABORTED));
try {
if (fs.exists(fullPath(CkpMessage.getFileName(instant, CkpMessage.State.INFLIGHT)))) {
fs.createNewFile(path);
}
fs.createNewFile(path);
} catch (IOException e) {
throw new HoodieException("Exception while adding checkpoint abort metadata for instant: " + instant);
}
Expand Down

0 comments on commit 3e8a36c

Please sign in to comment.