-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
small probability recursive lock (deadlock) when setting tidb_restricted_read_only
#55373
Comments
Stack trace:
|
It's trying to recursively get the same lock in The problem mainly comes from here: tidb/pkg/sessionctx/variable/sysvar.go Lines 822 to 831 in 2a731e6
This will potentially cause such a call stack:
Usually, this actually will not happen. Because in However, the session from the system session pool will contain information of the last executed internal SQL. If that SQL happens to be a SET statement, this deadlock will happen. |
tidb_restricted_read_only
tidb_restricted_read_only
it is found by the UT |
ref #48178 |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
I tried several times, in most times it can be triggered before the count reaches 5000.
2. What did you expect to see? (Required)
Execute and finish successfully.
3. What did you see instead (Required)
The SET statement above blocks forever, and any following SET GLOBAL statements will block forever.
4. What is your TiDB version? (Required)
I'm using v8.2.0 and master, but I believe many versions have this bug.
The text was updated successfully, but these errors were encountered: