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: creating / dropping the same user concurrently can cause a deadlock #75236

Open
RichardJCai opened this issue Jan 20, 2022 · 5 comments
Open
Assignees
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@RichardJCai
Copy link
Contributor

RichardJCai commented Jan 20, 2022

Likely the cause of this issue:
#74271 (comment)

This roachtest here non-deterministically reproduces the deadlock.

https://github.com/RichardJCai/cockroach/blob/create_user_concurrent_test/pkg/cmd/roachtest/tests/create_user_concurrent.go

Only tried on 21.2 since #74271 is failing on 21.2

Update: It repros on master as well.

Jira issue: CRDB-12524

@RichardJCai RichardJCai added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) labels Jan 20, 2022
@rafiss
Copy link
Collaborator

rafiss commented Jan 21, 2022

Could you try repeatedly doing GRANT admin TO user and REVOKE admin FROM user and see if that also has issues? I wonder if it relates to how we update the descriptor version of the system table.

@RichardJCai
Copy link
Contributor Author

Could you try repeatedly doing GRANT admin TO user and REVOKE admin FROM user and see if that also has issues? I wonder if it relates to how we update the descriptor version of the system table.

It does hang actually.

Also ran into this error

18:57:28 test_impl.go:323: test failure: 	sql_runner.go:63,create_user_concurrent.go:46: error executing 'GRANT admin TO testuser': pq: internal error: deadline below read timestamp is nonsensical; txn has would have no chance to commit. Deadline: 1642791448.730002636,1. Read timestamp: 1642791448.779620133,0 Previous Deadline: 1642791448.730002636,1.
panic: t.Fatal() was called

@rafiss
Copy link
Collaborator

rafiss commented Jan 31, 2022

The RandomSchemaChange test is also timing out: #75646 (comment)

So I wonder if there's a more general issue.

@RichardJCai
Copy link
Contributor Author

The RandomSchemaChange test is also timing out: #75646 (comment)

So I wonder if there's a more general issue.

If this is the same issue then it seems like it's been present for a long while.
#30893

@rafiss rafiss self-assigned this Feb 15, 2022
@rafiss rafiss assigned ZhouXing19 and unassigned rafiss Mar 2, 2022
@ZhouXing19
Copy link
Collaborator

The goroutine dump can be found here: https://gist.github.com/ZhouXing19/79a382f0c28a28fb56f6629f2e14d89b
cc @rafiss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

No branches or pull requests

4 participants