sql: execute batch statements in an implicit transaction#76834
Merged
craig[bot] merged 3 commits intocockroachdb:masterfrom Mar 15, 2022
Merged
sql: execute batch statements in an implicit transaction#76834craig[bot] merged 3 commits intocockroachdb:masterfrom
craig[bot] merged 3 commits intocockroachdb:masterfrom
Conversation
Member
c4f5971 to
7205a02
Compare
7205a02 to
417fddf
Compare
bd01597 to
1cde010
Compare
otan
reviewed
Feb 23, 2022
Contributor
otan
left a comment
There was a problem hiding this comment.
change by itself lgtm, but i think this may cause some tests to fail as they use multiple schema changes in the same cmd. the test failures seem suspicious as a result.
1cde010 to
1073168
Compare
1073168 to
d463dea
Compare
d463dea to
38d4cf7
Compare
49d30bc to
8ea59b7
Compare
8ea59b7 to
e138f8a
Compare
Contributor
|
Canceled. |
Collaborator
Author
|
bors r=otan |
craig bot
pushed a commit
that referenced
this pull request
Mar 15, 2022
76834: sql: execute batch statements in an implicit transaction r=otan a=rafiss fixes #44803 relates to #76490 Release justification: high value bug fix to existing functionality ### *: prepare tests for batch stmt txn change This commit will make the next one easier to review. ### sql: execute batch statements in an implicit transaction Release note (bug fix): Previously statements that arrived in a batch during the simple query protocol would all execute in their own implicit transactions. Now, we match the Postgres wire protocol, so all these statements share the same implicit transaction. If a BEGIN is included in a statement batch, then the existing implicit transaction is upgraded to an explicit transaction. ### sql: add session var for old implicit txn behavior Release note (sql change): The enable_implicit_transaction_for_batch_statements session variable was added. It defaults to true. When it is true, multiple statements in a single query (a.k.a. a "batch statement") will all be run in the same implicit transaction, which matches the Postgres wire protocol. This setting is provided for users who want to preserve the behavior of CockroachDB versions v21.2 and earlier. 77780: roachtest: update 22.1 version map to v21.2.7 r=celiala a=Azhng Release note: None Release justification: non-production code change. 77781: cloud: bump orchestrator to v21.2.7 r=celiala a=Azhng Release note: None Release justification: non-production code change. 77803: kvserverbase: move MaxCommandSizeDefault out of kvserver r=ajwerner a=ajwerner ``` $ bazel query "somepath(//pkg/sql, //pkg/kv/kvserver)" INFO: Empty results Loading: 0 packages loaded ``` Release justification: non-production code changes Release note: None Co-authored-by: Rafi Shamim <rafi@cockroachlabs.com> Co-authored-by: Azhng <archer.xn@gmail.com> Co-authored-by: Andrew Werner <awerner32@gmail.com>
53ecf6c to
3f45266
Compare
Contributor
|
Canceled. |
Collaborator
Author
|
bors r=otan |
Collaborator
Author
|
bors r- |
This commit will make the next one easier to review. Release justification: test only change Release note: None
Release justification: high value bug fix to existing functionality. Release note (bug fix): Previously statements that arrived in a batch during the simple query protocol would all execute in their own implicit transactions. Now, we match the Postgres wire protocol, so all these statements share the same implicit transaction. If a BEGIN is included in a statement batch, then the existing implicit transaction is upgraded to an explicit transaction.
Release justification: low risk new setting. Release note (sql change): The enable_implicit_transaction_for_batch_statements session variable was added. It defaults to true. When it is true, multiple statements in a single query (a.k.a. a "batch statement") will all be run in the same implicit transaction, which matches the Postgres wire protocol. This setting is provided for users who want to preserve the behavior of CockroachDB versions v21.2 and earlier.
3f45266 to
4fc43c8
Compare
Collaborator
Author
|
bors r=otan |
Contributor
|
Build succeeded: |
|
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating backport branch refs/heads/blathers/backport-release-21.2-76834: POST https://api.github.com/repos/cockroachlabs/cockroach/git/refs: 403 Resource not accessible by integration [] Backport to branch 21.2.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
This was referenced Mar 16, 2022
This was referenced Dec 15, 2022
Added enable_implicit_transaction_for_batch_statements to v22.2 release notes
cockroachdb/docs#15836
Merged
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.
fixes #44803
relates to #76490
Release justification: high value bug fix to existing functionality
*: prepare tests for batch stmt txn change
This commit will make the next one easier to review.
sql: execute batch statements in an implicit transaction
Release note (bug fix): Previously statements that arrived in a batch
during the simple query protocol would all execute in their own implicit
transactions. Now, we match the Postgres wire protocol, so all these
statements share the same implicit transaction. If a BEGIN is included
in a statement batch, then the existing implicit transaction is
upgraded to an explicit transaction.
sql: add session var for old implicit txn behavior
Release note (sql change): The enable_implicit_transaction_for_batch_statements
session variable was added. It defaults to true. When it is true,
multiple statements in a single query (a.k.a. a "batch statement") will
all be run in the same implicit transaction, which matches the Postgres
wire protocol. This setting is provided for users who want to preserve
the behavior of CockroachDB versions v21.2 and earlier.