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_r338172474
##########
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:
I made a mistake, the check should be `logicalSlot.getPayload() == null`
instead.
It's not problematic without this check at the moment.
But the check helps to ensure that no failover will be triggered by this
release action in case any faulty changes in the future. The possibility that a
failover can be triggered here would make the vertex state hard to track.
----------------------------------------------------------------
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