Skip to content

sql: step the sql transaction before commit#86461

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
ajwerner:ajwerner/fix-stepping-transaction-before-commit
Aug 19, 2022
Merged

sql: step the sql transaction before commit#86461
craig[bot] merged 1 commit intocockroachdb:masterfrom
ajwerner:ajwerner/fix-stepping-transaction-before-commit

Conversation

@ajwerner
Copy link
Copy Markdown
Contributor

In #86153 we added logic to step the transaction before auto-commit. This was
insufficient to resolve #86132 because we did not step the transaction before
committing an explicit transaction. This PR addresses that by moving the step
logic to a shared code path. It also adds a test which previously failed.

Fixes #86132

Release justification: bug fix

Release note: None

In cockroachdb#86153 we added logic to step the transaction before auto-commit. This was
insufficient to resolve cockroachdb#86132 because we did not step the transaction before
committing an explicit transaction. This PR addresses that by moving the step
logic to a shared code path. It also adds a test which previously failed.

Fixes cockroachdb#86132

Release justification: bug fix

Release note: None
@ajwerner ajwerner requested a review from knz August 19, 2022 16:46
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@knz knz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx

@ajwerner
Copy link
Copy Markdown
Contributor Author

TFTR!

bors r=knz

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 19, 2022

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 19, 2022

Build succeeded:

@craig craig bot merged commit fe19f5d into cockroachdb:master Aug 19, 2022
craig bot pushed a commit that referenced this pull request Aug 20, 2022
86433: server: proper transaction state management in sql-over-http  r=ajwerner a=ajwerner

First 4 commits are #86427.
Next commit is #86461.

We need to construct the internal executor in the context of the transaction
so that we can make sure that its side-effects are properly managed. Without
this change, we'd be throwing away all of the extraTxnState between each
statement. We'd fail to create the jobs (which we defer to the end of the
transaction), and we'd fail to run those jobs and check for errors. We'd
also fail to validate the two-version invariant or wait for one version.

Fixes #86332

Release justification: Fixes critical bugs in new functionality.

Release note: None

Co-authored-by: Andrew Werner <awerner32@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sql: CREATE SCHEMA fails if cluster setting server.eventlog.enabled is set to false

3 participants