-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
sql: disable write pipelining for implicit txns used by COPY #116092
Conversation
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.
Reviewed 8 of 8 files at r1, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @rafiss, @rharding6373, and @yuzefovich)
-- commits
line 13 at r1:
I feel like we shouldn't bother messing with explicit transactions. Doing so introduces confusing user-visible behavior to subsequent statements in a transaction which runs a COPY.
3bd52bf
to
59963ce
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @nvanbenschoten, @rafiss, and @rharding6373)
Previously, nvanbenschoten (Nathan VanBenschoten) wrote…
I feel like we shouldn't bother messing with explicit transactions. Doing so introduces confusing user-visible behavior to subsequent statements in a transaction which runs a COPY.
Ack, switched to disable pipelining only for implicit txns.
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.
This feels difficult to test, so I'll defer to you on whether we can add any unit tests for the change. If not though, have you manually tested with tracing to verify that this has the desired effect?
Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @rafiss and @rharding6373)
On top of #115674, I added the following diff:
which asserts that whenever COPY is executed outside of explicit txns (and within different scenarios), it has the pipelining disabled (and the test passes). Do you think it's worth including such an extension of |
I think the test I temporarily added is sufficient confirmation that the change works as expected and don't seem worthy of checking it in, so I'll omit it from the PR. TFTR! bors r+ |
Actually, I see a minor nit, one sec. bors r- |
Canceled. |
This commit makes it so that we disable write pipelining on implicit txns used by COPY. The rationale for that is that these are throughput-oriented txns which build large batches and shouldn’t be getting much benefit from write pipelining. It also introduces a session variable to be able to go back to the old behavior should we need to. Note that there are two places where we deal with txns in COPY: - the initial txn is created by the connExecutor state machine. It also might be explicit. In this case disabling the write pipelining is done only for the implicit txn. - for implicit txns with non-atomic COPY, we create a fresh txn after each batch. Epic: None Release note: None
59963ce
to
39e57c6
Compare
bors r+ |
Build succeeded: |
This commit makes it so that we disable write pipelining on implicit txns used by COPY. The rationale for that is that these are throughput-oriented txns which build large batches and shouldn’t be getting much benefit from write pipelining. It also introduces a session variable to be able to go back to the old behavior should we need to.
Note that there are two places where we deal with txns in COPY:
Epic: None
Release note: None