-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow skipping over tasks in schedulingQueue if wait limits hit #23470
Allow skipping over tasks in schedulingQueue if wait limits hit #23470
Conversation
I have a suspicion it could be written more simply |
45ae8f2
to
7f0ce9a
Compare
core/trino-main/src/main/java/io/trino/execution/scheduler/NodeSchedulerConfig.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/scheduler/NodeSchedulerConfig.java
Outdated
Show resolved
Hide resolved
.../java/io/trino/execution/scheduler/faulttolerant/EventDrivenFaultTolerantQueryScheduler.java
Outdated
Show resolved
Hide resolved
@@ -1913,6 +1905,14 @@ public Set<Map.Entry<ScheduledTask, PreSchedulingTaskContext>> listContextEntrie | |||
return contexts.entrySet(); | |||
} | |||
|
|||
private long getWaitingForNodeTasksCount(TaskExecutionClass executionClass) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: getTasksWaitingForNodeCount
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It gets split into two methods later and Tasks
is dropped from the name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I did some renames. PTAL
.../java/io/trino/execution/scheduler/faulttolerant/EventDrivenFaultTolerantQueryScheduler.java
Outdated
Show resolved
Hide resolved
.../java/io/trino/execution/scheduler/faulttolerant/EventDrivenFaultTolerantQueryScheduler.java
Outdated
Show resolved
Hide resolved
.../java/io/trino/execution/scheduler/faulttolerant/EventDrivenFaultTolerantQueryScheduler.java
Outdated
Show resolved
Hide resolved
7f0ce9a
to
ba98dc3
Compare
...src/main/java/io/trino/execution/scheduler/faulttolerant/BinPackingNodeAllocatorService.java
Outdated
Show resolved
Hide resolved
...src/main/java/io/trino/execution/scheduler/faulttolerant/BinPackingNodeAllocatorService.java
Outdated
Show resolved
Hide resolved
...src/main/java/io/trino/execution/scheduler/faulttolerant/BinPackingNodeAllocatorService.java
Show resolved
Hide resolved
If task suggests specific node for execution, but can be run elswhere, another node will be picked if designated node is out of resources for prolonged time.
If we are iterating over tasks in scheduling queue we may see that thera are already many tasks waiting for node lease for given requirements. In such case we are skipping a task and move to the next one, so one node does not block scheduling other tasks in queue which may have different node requirements. We are limiting how many tasks may be skipped to 20. This is to avoid pessimistic case that we are iterating over whole scheduling queue on each change in the cluster when it is highly utilized.
ba98dc3
to
f3d7900
Compare
Replaced with #23562 |
Description
If we are iterating over tasks in scheduling queue we may see that
there are already many tasks waiting for node lease for given requirements.
In such case we are skipping a task and move to the next one, so one node does not block
scheduling other tasks in queue which may have different node requirements.
We are limiting how many tasks may be skipped to 20. This is to avoid pessimistic case that we
are iterating over whole scheduling queue on each change in the cluster when it is highly utilized.
Additional context and related issues
Release notes
(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: