Skip to content

sql: fix race in TxnAborter#30670

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
andreimatei:txn-aborter
Sep 26, 2018
Merged

sql: fix race in TxnAborter#30670
craig[bot] merged 1 commit intocockroachdb:masterfrom
andreimatei:txn-aborter

Conversation

@andreimatei
Copy link
Copy Markdown
Contributor

TxnAborter was being used by several tests to modify server test knobs
after the server had started. That was racy; one can't simply change a
knob from under a running server.
The race was introduced in #22753 which needed to defer the activation
of the StatementFilter knob. Luckily, since then, the reason for that
deferment has gone away: the reason used to be that, if a
StatementFilter was installed, we enabled a check in the executor that
planning doesn't change the AST. The PR in question was making the
planner change the AST by qualifying tables with the public schema.
In the executor rewrite, we got rid of that check altogether, so this
patch restores the TxnAborter to setting up its knobs before the server
starts.

Fixes #29028

Release note: None

TxnAborter was being used by several tests to modify server test knobs
after the server had started. That was racy; one can't simply change a
knob from under a running server.
The race was introduced in cockroachdb#22753 which needed to defer the activation
of the StatementFilter knob. Luckily, since then, the reason for that
deferment has gone away: the reason used to be that, if a
StatementFilter was installed, we enabled a check in the executor that
planning doesn't change the AST. The PR in question was making the
planner change the AST by qualifying tables with the public schema.
In the executor rewrite, we got rid of that check altogether, so this
patch restores the TxnAborter to setting up its knobs before the server
starts.

Fixes cockroachdb#29028

Release note: None
@andreimatei andreimatei requested review from a team September 26, 2018 15:42
@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.

:lgtm: thank you!

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale)

@andreimatei
Copy link
Copy Markdown
Contributor Author

andreimatei commented Sep 26, 2018 via email

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Sep 26, 2018

Build failed

Copy link
Copy Markdown
Contributor Author

@andreimatei andreimatei left a comment

Choose a reason for hiding this comment

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

docker flake

bors r+

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

craig bot pushed a commit that referenced this pull request Sep 26, 2018
30670: sql: fix race in TxnAborter r=andreimatei a=andreimatei

TxnAborter was being used by several tests to modify server test knobs
after the server had started. That was racy; one can't simply change a
knob from under a running server.
The race was introduced in #22753 which needed to defer the activation
of the StatementFilter knob. Luckily, since then, the reason for that
deferment has gone away: the reason used to be that, if a
StatementFilter was installed, we enabled a check in the executor that
planning doesn't change the AST. The PR in question was making the
planner change the AST by qualifying tables with the public schema.
In the executor rewrite, we got rid of that check altogether, so this
patch restores the TxnAborter to setting up its knobs before the server
starts.

Fixes #29028

Release note: None

Co-authored-by: Andrei Matei <andrei@cockroachlabs.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Sep 26, 2018

Build succeeded

@craig craig bot merged commit 746c2a0 into cockroachdb:master Sep 26, 2018
@andreimatei andreimatei deleted the txn-aborter branch October 2, 2018 18:37
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.

3 participants