zhuzhurk commented on code in PR #20296:
URL: https://github.com/apache/flink/pull/20296#discussion_r926305085


##########
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ArchivedExecutionVertex.java:
##########
@@ -40,13 +43,25 @@ public class ArchivedExecutionVertex implements 
AccessExecutionVertex, Serializa
 
     private final ArchivedExecution currentExecution; // this field must never 
be null
 
+    private final Collection<AccessExecution> currentExecutions;
+
     // ------------------------------------------------------------------------
 
     public ArchivedExecutionVertex(ExecutionVertex vertex) {
         this.subTaskIndex = vertex.getParallelSubtaskIndex();
         this.executionHistory = getCopyOfExecutionHistory(vertex);
         this.taskNameWithSubtask = vertex.getTaskNameWithSubtaskIndex();
-        this.currentExecution = vertex.getCurrentExecutionAttempt().archive();
+
+        Execution vertexCurrentExecution = vertex.getCurrentExecutionAttempt();
+        assert vertex.getCurrentExecutions().contains(vertexCurrentExecution);

Review Comment:
   Better to use `Preconditions.checkState`.
   
   And it's better to check it in a more performant way, like:
   ```
   checkState(vertexCurrentExecution == 
vertex.getCurrentExecution(vertexCurrentExecution.getAttemptNumber));
   ```
   
   Or maybe we do not check it because it should be guaranteed by the 
`ExecutionVertex` itself.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to