[Scaling Writers] Close Idle Writers#19649
Conversation
8369ff3 to
118ec2c
Compare
plugin/trino-hive/src/main/java/io/trino/plugin/hive/HivePageSink.java
Outdated
Show resolved
Hide resolved
6623979 to
4db8545
Compare
74a19dd to
6785d7e
Compare
sopel39
left a comment
There was a problem hiding this comment.
some commits lgtm. Consider extracting it as separate PRs
core/trino-main/src/main/java/io/trino/operator/exchange/ScaleWriterPartitioningExchanger.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/operator/exchange/ScaleWriterPartitioningExchanger.java
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/operator/exchange/ScaleWriterPartitioningExchanger.java
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/operator/TableWriterOperator.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/HivePageSink.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/operator/TableWriterOperator.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/HivePageSink.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/HivePageSink.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/SystemSessionProperties.java
Outdated
Show resolved
Hide resolved
c435952 to
0bac20d
Compare
0bac20d to
a6b5663
Compare
97e3530 to
0786ee0
Compare
core/trino-main/src/main/java/io/trino/operator/TableWriterOperator.java
Outdated
Show resolved
Hide resolved
c6891a8 to
6b26c28
Compare
core/trino-main/src/main/java/io/trino/operator/DriverContext.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/SystemSessionProperties.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/operator/TableWriterOperator.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveSessionProperties.java
Outdated
Show resolved
Hide resolved
|
a high level question at this point
This is always a good idea to reclaim unused resources! |
Peak memory usage will reduce in the case of idle writers since we are closing the writers and reclaiming their resources early on.
We do not change anything wrt the maximum number of open partitions (or writers). Currently, when we close the idle writer, we set its index to |
4bdc124 to
3a4254e
Compare
3a4254e to
61f7243
Compare
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/AbstractDeltaLakePageSink.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergPageSink.java
Outdated
Show resolved
Hide resolved
This change will help in reducing memory footprint in long-running partitioned writes. Thus, we can scale more to increase the write performance.
61f7243 to
52c0c96
Compare
Description
In this PR there are following changes:
Additional context and related issues
Benchmarks:
Before:
With memory constraints:
peak memory used: ~128GB
Without memory constraints:
peak memory used: ~700GB
After:
peak memory used: ~450GB
Another benchmark with limited max memory per node:
Release notes
( ) 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: