-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
ddl: fix panic tidb-server doesn't release table lock (#19586) #20020
ddl: fix panic tidb-server doesn't release table lock (#19586) #20020
Conversation
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
/run-all-tests |
Signed-off-by: crazycs520 <crazycs520@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-tests |
@lzmhhh123,Thanks for your review. The bot only counts LGTMs from Reviewers and higher roles, but you're still welcome to leave your comments.See the corresponding SIG page for more information. Related SIG: ddl(slack). |
/merge |
Your auto merge job has been accepted, waiting for:
|
/run-all-tests |
cherry-pick #19586 to release-4.0
What problem does this PR solve?
Close #19240
When
tidb-server
beenkilled -9
(such as oom that killed by the system), the tidb-server won't release the held table locks, and thisdead
table lock will never be released unless user useadmin cleanup table lock
statement.What is changed and how it works?
Add a background goroutine to periodic inspection the
dead
lock.If the lock is held by the server that doesn't exist meta key (such as
DDLAllSchemaVersions
meta key) in ETCD, we think the server is dead, so we can clean the locks that hold by the dead tidb-server.Why use
DDLAllSchemaVersions
meta key instead ofServerInformationPath
meta key?Table lock
implementation with DDL, andDDLAllSchemaVersions
meta key is a related DDL meta key.DDLAllSchemaVersions
TTL is 90s, butServerInformationPath
TTL is 10 min. The TTL90s
is much better for usage.Related changes
Check List
Tests
Side effects
Release note