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

TiDB does not clean table lock if restart on OOM #19240

Closed
marsishandsome opened this issue Aug 17, 2020 · 5 comments · Fixed by #19586
Closed

TiDB does not clean table lock if restart on OOM #19240

marsishandsome opened this issue Aug 17, 2020 · 5 comments · Fixed by #19586
Assignees
Labels
severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@marsishandsome
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

tidb config

# enable-table-lock is used to control the table lock feature. The default value is false, indicating that the table lock feature is disabled.
enable-table-lock: true

# delay-clean-table-lock is used to control the time (milliseconds) of delay before unlocking the table in abnormal situations.
delay-clean-table-lock: 60000
  1. lock tables test.tt write local
  2. kill -9 tidb
  3. start tidb
  4. wait 60 seconds
  5. lock tables test.tt write local
  6. get error: Table tt was lock in WRITE LOCAL by server

2. What did you expect to see? (Required)

TiDB should clean table lock if restart on OOM

3. What did you see instead (Required)

success to lock table

4. What is your TiDB version? (Required)

3.0.14

@marsishandsome marsishandsome added the type/bug The issue is confirmed as a bug. label Aug 17, 2020
@ekexium
Copy link
Contributor

ekexium commented Aug 17, 2020

/label sig/DDL

@ekexium
Copy link
Contributor

ekexium commented Aug 18, 2020

/label sig/DDL

@sre-bot
Copy link
Contributor

sre-bot commented Sep 16, 2020

Integrity check:
component RCA symptom affect_version fix_version fields are empty
@crazycs520
Please comment /info to get template

@ti-srebot
Copy link
Contributor

ti-srebot commented Sep 16, 2020

Please edit this comment to complete the following information

Bug

1. Root Cause Analysis (RCA)

This bug only affects the TiDB cluster which config has enable-table-lock = true, indicates the enable the table lock feature.

If tidb-server was been kill -9 (such as OOM that killed by the system), the killed tidb-server will have no change to release the held table lock, so those table lock will not been released unless the user uses admin cleanup table lock [table_name] statement to force clean table lock.

2. Symptom

Lock table statement execute failed.

3. Minimal steps to reproduce the bug (optional)

4. Solution (optional)

  • Upgrade

5. W/A (Workaround)

Uses admin cleanup table lock [table_name] statement to force release table lock.

6. Affected versions

[v3.0.14:v3.0.18],
[v3.1.0:v3.1.2],
[v4.0.0:v4.0.6]

7. Fixed versions

v3.0.19
v3.1.3
v4.0.7

@seiya-annie
Copy link

Please edit this comment to complete the following information

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA)

This bug only affects the TiDB cluster which config has enable-table-lock = true, indicates the enable the table lock feature.

If tidb-server was been kill -9 (such as OOM that killed by the system), the killed tidb-server will have no change to release the held table lock, so those table lock will not been released unless the user uses admin cleanup table lock [table_name] statement to force clean table lock.

2. Symptom

Lock table statement execute failed.

3. All Trigger Conditions

see in issue body

4. Workaround (optional)

Uses admin cleanup table lock [table_name] statement to force release table lock.

5. Affected versions

[v3.0.14:v3.0.18],
[v3.1.0:v3.1.2],
[v4.0.0:v4.0.6]

6. Fixed versions

v3.0.19
v3.1.3
v4.0.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants