Skip to content

Commit fae74b3

Browse files
authored
[Runtime] Fix checkpoint causing empty results in PipelineServiceExecutorContext (#543) (#544)
* fix checkpoint causing empty results in interactive query * skip checkpoint when context is PipelineServiceExecutorContext
1 parent d4e8bd2 commit fae74b3

6 files changed

Lines changed: 15 additions & 12 deletions

File tree

geaflow/geaflow-core/geaflow-runtime/geaflow-pipeline/src/main/java/com/antgroup/geaflow/runtime/pipeline/runner/PipelineRunner.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,13 @@ private ICycleSchedulerContext loadOrCreateContext(IPipelineExecutorContext pipe
106106

107107
Map<Integer, List<ExecutionTask>> vertex2Tasks = ExecutionCycleTaskAssigner.assign(graph);
108108

109+
// Skip checkpoint if it's a PipelineServiceExecutorContext
110+
boolean skipCheckpoint = pipelineExecutorContext instanceof PipelineServiceExecutorContext;
109111
IExecutionCycle cycle = ExecutionCycleBuilder.buildExecutionCycle(graph, vertex2Tasks,
110112
pipelineContext.getConfig(), ExecutionIdGenerator.getInstance().generateId(),
111113
pipelineExecutorContext.getPipelineTaskId(), pipelineExecutorContext.getPipelineTaskName(),
112114
ExecutionIdGenerator.getInstance().generateId(), pipelineExecutorContext.getDriverId(),
113-
pipelineExecutorContext.getDriverIndex());
115+
pipelineExecutorContext.getDriverIndex(), skipCheckpoint);
114116
return CycleSchedulerContextFactory.create(cycle, null);
115117
});
116118
return context;

geaflow/geaflow-core/geaflow-runtime/geaflow-runtime-core/src/main/java/com/antgroup/geaflow/runtime/core/scheduler/cycle/ExecutionCycleBuilder.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public static IExecutionCycle buildExecutionCycle(ExecutionGraph executionGraph,
4545
String name,
4646
long schedulerId,
4747
String driverId,
48-
int driverIndex) {
48+
int driverIndex,
49+
boolean skipCheckpoint) {
4950

5051
int flyingCount = executionGraph.getCycleGroupMeta().getFlyingCount();
5152
long iterationCount = executionGraph.getCycleGroupMeta().getIterationCount();
@@ -54,7 +55,7 @@ public static IExecutionCycle buildExecutionCycle(ExecutionGraph executionGraph,
5455
for (ExecutionVertexGroup vertexGroup : executionGraph.getVertexGroupMap().values()) {
5556
ExecutionNodeCycle nodeCycle = buildExecutionCycle(vertexGroup,
5657
vertex2Tasks, config, pipelineId, pipelineTaskId, name, schedulerId, driverId, driverIndex);
57-
graphCycle.addCycle(nodeCycle);
58+
graphCycle.addCycle(nodeCycle, skipCheckpoint);
5859
}
5960
return graphCycle;
6061
}

geaflow/geaflow-core/geaflow-runtime/geaflow-runtime-core/src/main/java/com/antgroup/geaflow/runtime/core/scheduler/cycle/ExecutionGraphCycle.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public HighAvailableLevel getHighAvailableLevel() {
6868
return haLevel;
6969
}
7070

71-
public void addCycle(IExecutionCycle cycle) {
71+
public void addCycle(IExecutionCycle cycle, boolean skipCheckpoint) {
7272
if (cycleMap.containsKey(cycle.getCycleId())) {
7373
throw new GeaflowRuntimeException(String.format("cycle %d already added", cycle.getCycleId()));
7474
}
@@ -80,8 +80,8 @@ public void addCycle(IExecutionCycle cycle) {
8080
cycleParents.get(cycle.getCycleId()).addAll(nodeCycle.getVertexGroup().getParentVertexGroupIds());
8181
cycleChildren.get(cycle.getCycleId()).addAll(nodeCycle.getVertexGroup().getChildrenVertexGroupIds());
8282

83-
if (iterationCount > 1 && haLevel != HighAvailableLevel.CHECKPOINT
84-
&& (cycle.getType() == ExecutionCycleType.ITERATION || cycle.getType() == ExecutionCycleType.ITERATION_WITH_AGG)) {
83+
if (!skipCheckpoint && (iterationCount > 1 && haLevel != HighAvailableLevel.CHECKPOINT
84+
&& (cycle.getType() == ExecutionCycleType.ITERATION || cycle.getType() == ExecutionCycleType.ITERATION_WITH_AGG))) {
8585
haLevel = HighAvailableLevel.CHECKPOINT;
8686
}
8787
}

geaflow/geaflow-core/geaflow-runtime/geaflow-runtime-core/src/test/java/com/antgroup/geaflow/runtime/core/scheduler/ExecutionGraphCycleSchedulerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ private ExecutionGraphCycle buildMockGraphCycle() {
206206
1, 10, configuration, "driver_id", 0);
207207
ExecutionNodeCycle nodeCycle = buildMockIterationNodeCycle(configuration);
208208

209-
graphCycle.addCycle(nodeCycle);
209+
graphCycle.addCycle(nodeCycle, false);
210210
try {
211211
ReflectionUtil.setField(graphCycle, "haLevel", CHECKPOINT);
212212
} catch (Exception e) {

geaflow/geaflow-core/geaflow-runtime/geaflow-runtime-core/src/test/java/com/antgroup/geaflow/runtime/core/scheduler/context/ExecutionGraphCycleSchedulerContextTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void testExecutionGraphWithCheckpointChileCycle() {
4040
parentContext.init(1);
4141

4242
ExecutionNodeCycle iterationCycle = buildPipelineCycle(false, finishIterationId);
43-
graph.addCycle(iterationCycle);
43+
graph.addCycle(iterationCycle, false);
4444
CheckpointSchedulerContext iterationContext = new CheckpointSchedulerContext(iterationCycle, parentContext);
4545
iterationContext.init();
4646

geaflow/geaflow-core/geaflow-runtime/geaflow-runtime-core/src/test/java/com/antgroup/geaflow/runtime/core/scheduler/cycle/ExecutionCycleBuilderTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void validateGraphCycleFlyingCount() {
3535
meta.setFlyingCount(0);
3636
meta.setGroupType(CycleGroupType.windowed);
3737

38-
ExecutionCycleBuilder.buildExecutionCycle(executionGraph, null, null, 0, 0, null, 0,null, 0);
38+
ExecutionCycleBuilder.buildExecutionCycle(executionGraph, null, null, 0, 0, null, 0,null, 0, false);
3939
}
4040

4141
@Test(expectedExceptions = IllegalArgumentException.class,
@@ -45,7 +45,7 @@ public void validateGraphCycleIterationCount() {
4545
CycleGroupMeta meta = executionGraph.getCycleGroupMeta();
4646
meta.setIterationCount(0);
4747
meta.setGroupType(CycleGroupType.windowed);
48-
ExecutionCycleBuilder.buildExecutionCycle(executionGraph, null, null, 0, 0, null, 0, null, 0);
48+
ExecutionCycleBuilder.buildExecutionCycle(executionGraph, null, null, 0, 0, null, 0, null, 0, false);
4949
}
5050

5151
@Test(expectedExceptions = IllegalArgumentException.class,
@@ -62,7 +62,7 @@ public void validateNodeCycleFlyingCount() {
6262
executionGraph.getVertexGroupMap().put(1, vertexGroup);
6363

6464
ExecutionCycleBuilder.buildExecutionCycle(executionGraph, null, null, 0, 0, null, 0, null,
65-
0);
65+
0, false);
6666
}
6767

6868
@Test(expectedExceptions = IllegalArgumentException.class,
@@ -79,6 +79,6 @@ public void validateNodeCycleIterationCount() {
7979
executionGraph.getVertexGroupMap().put(1, vertexGroup);
8080

8181
ExecutionCycleBuilder.buildExecutionCycle(executionGraph, null, null, 0, 0, null, 0, null,
82-
0);
82+
0, false);
8383
}
8484
}

0 commit comments

Comments
 (0)