tillrohrmann commented on a change in pull request #10646:
[FLINK-15320][runtime] Increment versions of all vertices when
failing/canceling/suspending a job
URL: https://github.com/apache/flink/pull/10646#discussion_r360839936
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/DefaultSchedulerTest.java
##########
@@ -550,6 +550,53 @@ public void testInputConstraintALLPerf() throws Exception
{
assertThat(duration, lessThan(timeout));
}
+ @Test
+ public void failJobWillIncrementVertexVersions() {
+ final JobGraph jobGraph = singleNonParallelJobVertexJobGraph();
+ final JobVertex onlyJobVertex = getOnlyJobVertex(jobGraph);
+ final ExecutionVertexID onlyExecutionVertexId = new
ExecutionVertexID(onlyJobVertex.getID(), 0);
+
+ // suppress restarts so any task failure will lead to job
failure
+ testRestartBackoffTimeStrategy.setCanRestart(false);
+ final DefaultScheduler scheduler =
createSchedulerAndStartScheduling(jobGraph);
+
+ final ArchivedExecutionVertex archivedExecutionVertex =
Iterables.getOnlyElement(scheduler.requestJob().getAllExecutionVertices());
+ final ExecutionAttemptID attemptId =
archivedExecutionVertex.getCurrentExecutionAttempt().getAttemptId();
+
+ scheduler.updateTaskExecutionState(new
TaskExecutionState(jobGraph.getJobID(), attemptId, ExecutionState.FAILED));
+
+ final ExecutionVertexVersioner executionVertexVersioner =
scheduler.getExecutionVertexVersioner();
+ assertTrue(executionVertexVersioner.isModified(new
ExecutionVertexVersion(onlyExecutionVertexId, 1)));
Review comment:
I think this encodes some implementation details that the first recorded
version starts with `1`. It would be better to ask the
`executionVertexVersioner` about the `ExecutionVertexVersion` before triggering
the `failJob` call and then compare this value against the currently recorded
value.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services