zentol commented on a change in pull request #8778: [FLINK-12615][coordination] 
Track partitions on JM
URL: https://github.com/apache/flink/pull/8778#discussion_r297555765
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobMaster.java
 ##########
 @@ -883,6 +883,17 @@ private void jobStatusChanged(
                validateRunsInMainThread();
 
                if (newJobStatus.isGloballyTerminalState()) {
+                       // other terminal job states are handled by the 
executions
+                       if (newJobStatus == JobStatus.FINISHED) {
+                               runAsync(() -> {
+                                       for (Map.Entry<ResourceID, 
Tuple2<TaskManagerLocation, TaskExecutorGateway>> entry : 
registeredTaskManagers.entrySet()) {
+                                               Collection<ResultPartitionID> 
storedPartitions = partitionTable.stopTrackingPartitions(entry.getKey());
+                                               // if this call fails 
TaskExecutors will cleanup partitions regardless once we close the connections
+                                               
entry.getValue().f1.releasePartitions(jobGraph.getJobID(), storedPartitions);
 
 Review comment:
   ah yes, I got stuck here since the SM requires a ShuffleDescriptor, but so 
far we've only been tracking ResultPartitionIDs.
   I have updated the PR to include a PartitionTracker which keeps track of 
shuffle descriptor, result partition ids etc. and acts as a central point for 
issuing release calls.

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

Reply via email to