jiangxin369 commented on code in PR #22670:
URL: https://github.com/apache/flink/pull/22670#discussion_r1245097018
##########
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/SchedulerBase.java:
##########
@@ -236,6 +239,16 @@ public SchedulerBase(
this.exceptionHistory =
new BoundedFIFOQueue<>(
jobMasterConfiguration.getInteger(WebOptions.MAX_EXCEPTION_HISTORY_SIZE));
+
+ this.finishingTasks = createFinishingTasks();
+ }
+
+ private Map<JobVertexID, BitSet> createFinishingTasks() {
+ Map<JobVertexID, BitSet> map = new HashMap<>();
+ for (ExecutionJobVertex vertex :
getExecutionGraph().getAllVertices().values()) {
+ map.put(vertex.getJobVertexId(), new BitSet());
Review Comment:
Based on my test case, yes JM will allocate slots for finished tasks when
restoring but I didn't find out the doc that states this point. Maybe the
following stack trace can illustrate that the scheduler would allocate slots
for all vertices of the jobgraph, regardless of whether it has been completed
before.
I will continue to delve deeper into the code to find the evidence, but I
hope it doesn't block your review.
```
allocateSlotsFor:106, SlotSharingExecutionSlotAllocator
(org.apache.flink.runtime.scheduler)
allocateSlotsFor:127, DefaultExecutionDeployer
(org.apache.flink.runtime.scheduler)
allocateSlotsAndDeploy:98, DefaultExecutionDeployer
(org.apache.flink.runtime.scheduler)
allocateSlotsAndDeploy:483, DefaultScheduler
(org.apache.flink.runtime.scheduler)
scheduleRegion:287, PipelinedRegionSchedulingStrategy
(org.apache.flink.runtime.scheduler.strategy)
accept:-1, 1191666286
(org.apache.flink.runtime.scheduler.strategy.PipelinedRegionSchedulingStrategy$$Lambda$1307)
forEach:1259, ArrayList (java.util)
maybeScheduleRegions:233, PipelinedRegionSchedulingStrategy
(org.apache.flink.runtime.scheduler.strategy)
startScheduling:187, PipelinedRegionSchedulingStrategy
(org.apache.flink.runtime.scheduler.strategy)
startSchedulingInternal:243, DefaultScheduler
(org.apache.flink.runtime.scheduler)
startScheduling:623, SchedulerBase (org.apache.flink.runtime.scheduler)
startScheduling:1069, JobMaster (org.apache.flink.runtime.jobmaster)
startJobExecution:986, JobMaster (org.apache.flink.runtime.jobmaster)
onStart:432, JobMaster (org.apache.flink.runtime.jobmaster)
```
--
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]