-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add upper limit on number of tasks that take part in writing stages #16238
Add upper limit on number of tasks that take part in writing stages #16238
Conversation
I will add more tests after we agree that this approach is ok. |
713aae5
to
6906e11
Compare
.../trino-main/src/main/java/io/trino/execution/scheduler/PartitioningHandlePartitionCount.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/planner/optimizations/AddExchanges.java
Outdated
Show resolved
Hide resolved
6906e11
to
2bb3511
Compare
core/trino-main/src/main/java/io/trino/execution/scheduler/PipelinedQueryScheduler.java
Outdated
Show resolved
Hide resolved
...rino-main/src/test/java/io/trino/sql/planner/optimizations/TestLimitMaxWriterNodesCount.java
Outdated
Show resolved
Hide resolved
...rino-main/src/test/java/io/trino/sql/planner/optimizations/TestLimitMaxWriterNodesCount.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/SystemSessionProperties.java
Outdated
Show resolved
Hide resolved
There are some relevant CI failures. Please fix them |
Can we also have an integration test in |
2bb3511
to
f3bd21e
Compare
Sure, as I wrote here: #16238 (comment) I am going to add new tests after we agree this approach is ok. |
f3bd21e
to
16aded6
Compare
|
16aded6
to
203784d
Compare
core/trino-main/src/main/java/io/trino/SystemSessionProperties.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/QueryManagerConfig.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/scheduler/PipelinedQueryScheduler.java
Show resolved
Hide resolved
203784d
to
7afb274
Compare
core/trino-main/src/main/java/io/trino/sql/planner/LogicalPlanner.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/planner/optimizations/AddExchanges.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/planner/optimizations/AddExchanges.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/planner/optimizations/AddExchanges.java
Outdated
Show resolved
Hide resolved
ae493bb
to
fdfca2a
Compare
Map's key in PipelinedQueryScheduler.partitioningCacheMap is built only from partitioningHandle parameter. If any two stages has same partitioning but different number of partitions the key does not reflect that. This is why key was extended with partitionCount.
fdfca2a
to
7240ab1
Compare
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.
lgtm % comments
core/trino-main/src/main/java/io/trino/SystemSessionProperties.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/QueryManagerConfig.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/QueryManagerConfig.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/scheduler/PipelinedQueryScheduler.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/planner/optimizations/AddExchanges.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/planner/optimizations/AddExchanges.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/planner/plan/TableWriterNode.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/planner/plan/TableWriterNode.java
Outdated
Show resolved
Hide resolved
1009e95
to
c56bc02
Compare
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.
minor comments
core/trino-main/src/main/java/io/trino/sql/planner/optimizations/AddExchanges.java
Outdated
Show resolved
Hide resolved
Limit number of tasks that will be scheduled to execute writing stages basing on needs of specific connector or global limit - query.max-writer-nodes-count. Added an option query.max-writer-nodes-count to QueryManagerConfig and a session option that limits number of tasks that take part in writing nodes.
884826e
to
738e3dc
Compare
738e3dc
to
fa9a667
Compare
Thx! |
Description
The option
query.max-writer-node-count
was added to limit number of nodes that take part in executing writer stages.Roughly, it was implemented by some changes in
ScaledWriterScheduler
(for unpartitioned data) and by changing theAddExchanges
rule (mostly for partitioned data).Release notes
() This is not user-visible or 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:
Add posibility to limit number of writing tasks.
Documentation
There is a change in this PR