Skip to content
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: rollback past DDL causes deadlock #45793

Closed
knz opened this issue Mar 6, 2020 · 4 comments
Closed

sql: rollback past DDL causes deadlock #45793

knz opened this issue Mar 6, 2020 · 4 comments
Assignees

Comments

@knz
Copy link
Contributor

knz commented Mar 6, 2020

The check for DDL that I introduced in #43051 was broken in #45566. Try this:

  1. issue BEGIN; SELECT 1, wait for results to ensure the auto-retry is disabled

  2. issue: SAVEPOINT foo; CREATE TABLE t(x INT); SELECT crdb_internal.force_retry('1h');

so far all good

  1. issue: ROLLBACK TO SAVEPOINT foo

  2. issue: SELECT * FROM t

boom - deadlock.

Expected either of the following:

  1. "cannot rollback to savepoint after a transaction restart" (your other check)
  2. "rollback after DDL is not yet supported" (my original check)
  3. "t does not exist" (schema change properly rolled back)
@knz knz changed the title sql: DDL check in savepoints is broken sql: rollback past DDL causes deadlock Mar 6, 2020
@knz
Copy link
Contributor Author

knz commented Mar 6, 2020

This is different from #24885 I think? Because we're looking at a savepoint past the begin of the txn.

@knz
Copy link
Contributor Author

knz commented Mar 6, 2020

Also the severity is higher than the original report because once we announce savepoint support this pattern of txn is more likely to be issued by clients.

@andreimatei
Copy link
Contributor

I think it is #24885. You don't need the force_retry() to repro, do you?
I'll try to do something about it

@andreimatei
Copy link
Contributor

Closing in favor of #24885.

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

No branches or pull requests

2 participants