zhuzhurk commented on a change in pull request #9902: [FLINK-14363][runtime]
Prevent vertex from being affected by outdated deployment
URL: https://github.com/apache/flink/pull/9902#discussion_r338607585
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/DefaultScheduler.java
##########
@@ -412,13 +412,17 @@ private static Throwable
maybeWrapWithNoResourceAvailableException(final Throwab
};
}
- private void stopDeployment(final DeploymentHandle deploymentHandle) {
- cancelExecutionVertex(deploymentHandle.getExecutionVertexId());
+ private void releaseUnassignedSlotIfPresent(final DeploymentHandle
deploymentHandle) {
// Canceling the vertex normally releases the slot. However, we
might not have assigned
// the slot to the vertex yet.
+ // Only release unassigned slot to guarantee no vertex state
change happens here.
deploymentHandle
.getLogicalSlot()
- .ifPresent(logicalSlot ->
logicalSlot.releaseSlot(null));
+ .ifPresent(logicalSlot -> {
+ if (logicalSlot.getPayload() != null) {
Review comment:
Yes. For `deployIndividually()` the release logic for outdated deployment is
also not needed. (`deployIndividually()` has a problem to not handle the
unexpected error correctly, this is a different issue that can be fixed in
FLINK-14162).
> However, the test can be kept.
If you mean the `skipDeploymentIfVertexVersionOutdated` test case, agreed we
still need it.
----------------------------------------------------------------
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