Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FLINK-26803][checkpoint] Merging channel state files #20151

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

Merged
merged 3 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
<td>Duration</td>
<td>Only relevant if <code class="highlighter-rouge">execution.checkpointing.unaligned.enabled</code> is enabled.<br /><br />If timeout is 0, checkpoints will always start unaligned.<br /><br />If timeout has a positive value, checkpoints will start aligned. If during checkpointing, checkpoint start delay exceeds this timeout, alignment will timeout and checkpoint barrier will start working as unaligned checkpoint.</td>
</tr>
<tr>
<td><h5>execution.checkpointing.unaligned.max-subtasks-per-channel-state-file</h5></td>
<td style="word-wrap: break-word;">5</td>
<td>Integer</td>
<td>Defines the maximum number of subtasks that share the same channel state file. It can reduce the number of small files when enable unaligned checkpoint. Each subtask will create a new channel state file when this is configured to 1.</td>
</tr>
<tr>
<td><h5>execution.checkpointing.checkpoints-after-tasks-finish.enabled</h5></td>
<td style="word-wrap: break-word;">true</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.apache.flink.runtime.checkpoint.CheckpointMetrics;
import org.apache.flink.runtime.checkpoint.PrioritizedOperatorSubtaskState;
import org.apache.flink.runtime.checkpoint.TaskStateSnapshot;
import org.apache.flink.runtime.checkpoint.channel.ChannelStateWriteRequestExecutorFactory;
import org.apache.flink.runtime.execution.Environment;
import org.apache.flink.runtime.executiongraph.ExecutionAttemptID;
import org.apache.flink.runtime.executiongraph.ExecutionGraphID;
Expand Down Expand Up @@ -107,6 +108,8 @@ public class SavepointEnvironment implements Environment {

private final UserCodeClassLoader userCodeClassLoader;

private final ChannelStateWriteRequestExecutorFactory channelStateExecutorFactory;

private SavepointEnvironment(
RuntimeContext ctx,
Configuration configuration,
Expand All @@ -133,6 +136,7 @@ private SavepointEnvironment(
this.accumulatorRegistry = new AccumulatorRegistry(jobID, attemptID);

this.userCodeClassLoader = UserCodeClassLoaderRuntimeContextAdapter.from(ctx);
this.channelStateExecutorFactory = new ChannelStateWriteRequestExecutorFactory(jobID);
}

@Override
Expand Down Expand Up @@ -306,6 +310,11 @@ public TaskEventDispatcher getTaskEventDispatcher() {
throw new UnsupportedOperationException(ERROR_MSG);
}

@Override
public ChannelStateWriteRequestExecutorFactory getChannelStateExecutorFactory() {
return channelStateExecutorFactory;
}

/** {@link SavepointEnvironment} builder. */
public static class Builder {
private RuntimeContext ctx;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ public void checkFailureCounter(CheckpointException exception, long checkpointId
case CHECKPOINT_SUBSUMED:
case CHECKPOINT_COORDINATOR_SUSPEND:
case CHECKPOINT_COORDINATOR_SHUTDOWN:
case CHANNEL_STATE_SHARED_STREAM_EXCEPTION:
case JOB_FAILOVER_REGION:
// for compatibility purposes with user job behavior
case CHECKPOINT_DECLINED_TASK_NOT_READY:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public enum CheckpointFailureReason {

CHECKPOINT_ASYNC_EXCEPTION(false, "Asynchronous task checkpoint failed."),

CHANNEL_STATE_SHARED_STREAM_EXCEPTION(
false,
"The checkpoint was aborted due to exception of other subtasks sharing the ChannelState file."),

CHECKPOINT_EXPIRED(false, "Checkpoint expired before completing."),

CHECKPOINT_SUBSUMED(false, "Checkpoint has been subsumed."),
Expand Down
Loading