-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Make JDBC write parallelism configurable #16280
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
Conversation
On top of the #16238 |
112df4a
to
bb789cd
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.
Nice :)
plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcClient.java
Show resolved
Hide resolved
plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/DefaultJdbcMetadata.java
Show resolved
Hide resolved
bb789cd
to
1791466
Compare
Rebased and addressed review. |
plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcWriteConfig.java
Show resolved
Hide resolved
Note that maybe default should be |
@hashhar I'd prefer a sane default, rather than previous behavior. |
22bdf8d
to
587d00c
Compare
plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcWriteConfig.java
Show resolved
Hide resolved
plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/BaseJdbcClient.java
Show resolved
Hide resolved
587d00c
to
9669ffe
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 % comment
@@ -22,8 +22,10 @@ | |||
public class JdbcWriteConfig | |||
{ | |||
public static final int MAX_ALLOWED_WRITE_BATCH_SIZE = 10_000_000; | |||
static final int DEFAULT_WRITE_PARALELLISM = 8; |
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.
by default QueryManagerConfig
defines maxWriterTasksCount = 100
so this is a drastic reduction of writers. Is it by intention?
I see, that it's only for jdbc, so it's probably acceptable and 8 is even better than 100.
Should it be documented?
@jhlodin
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.
100 means unbounded. for jdbc the higher number of writers, the bigger number of connections opened/acquired/held per write which can result in high lock contention on the database side.
Does this need a release note? @wendigo |
I think yes... and also docs.. |
getQueryRunner()::execute, | ||
"write_parallelism", | ||
"(a varchar(128), b bigint)")) { | ||
assertUpdate(session, "INSERT INTO " + table.getName() + " (a, b) SELECT clerk, orderkey FROM tpch.sf100.orders LIMIT " + numberOfRows, numberOfRows, plan -> { |
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.
very generous
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.
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.
Description
Additional context and related issues
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: