Add upper limit on number of tasks that take part in writing stages#16238
Merged
sopel39 merged 3 commits intotrinodb:masterfrom Mar 17, 2023
Conversation
Contributor
Author
|
I will add more tests after we agree that this approach is ok. |
713aae5 to
6906e11
Compare
gaurav8297
reviewed
Feb 24, 2023
.../trino-main/src/main/java/io/trino/execution/scheduler/PartitioningHandlePartitionCount.java
Outdated
Show resolved
Hide resolved
gaurav8297
reviewed
Feb 24, 2023
core/trino-main/src/main/java/io/trino/sql/planner/optimizations/AddExchanges.java
Outdated
Show resolved
Hide resolved
gaurav8297
reviewed
Feb 24, 2023
6906e11 to
2bb3511
Compare
gaurav8297
reviewed
Feb 27, 2023
core/trino-main/src/main/java/io/trino/execution/scheduler/PipelinedQueryScheduler.java
Outdated
Show resolved
Hide resolved
gaurav8297
reviewed
Feb 27, 2023
...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
gaurav8297
reviewed
Feb 27, 2023
gaurav8297
reviewed
Feb 27, 2023
core/trino-main/src/main/java/io/trino/SystemSessionProperties.java
Outdated
Show resolved
Hide resolved
Member
|
There are some relevant CI failures. Please fix them |
Member
|
Can we also have an integration test in |
2bb3511 to
f3bd21e
Compare
Contributor
Author
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
Contributor
|
16aded6 to
203784d
Compare
gaurav8297
reviewed
Feb 28, 2023
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
gaurav8297
reviewed
Feb 28, 2023
gaurav8297
reviewed
Feb 28, 2023
core/trino-main/src/main/java/io/trino/execution/scheduler/PipelinedQueryScheduler.java
Outdated
Show resolved
Hide resolved
203784d to
7afb274
Compare
sopel39
reviewed
Mar 8, 2023
core/trino-main/src/main/java/io/trino/SystemSessionProperties.java
Outdated
Show resolved
Hide resolved
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
sopel39
approved these changes
Mar 10, 2023
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/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/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
sopel39
approved these changes
Mar 15, 2023
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/SystemSessionProperties.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
Closed
Member
|
Thx! |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The option
query.max-writer-node-countwas 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 theAddExchangesrule (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