The mdl lock is not fully effective when multiple clients simultaneously truncate the table. #40484
Labels
affects-6.3
affects-6.4
affects-6.5
This bug affects the 6.5.x(LTS) versions.
severity/moderate
sig/sql-infra
SIG: SQL Infra
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
mysql> desc test.t1;
+-------+---------+------+------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------+------+------+---------+-------+
| id | int(11) | YES | | NULL | |
+-------+---------+------+------+---------+-------+
1 row in set (0.00 sec)
insert into test.t1 values (1),(2),(3);
session 1: begin; select * from test.t1 for update ;
session 2: truncate table test.t1;
session 3: truncate table test.t1;
2. What did you expect to see? (Required)
session 2 and session 3 are both blocked by metadata lock
3. What did you see instead (Required)
session3 truncated data successfully
4. What is your TiDB version? (Required)
| Release Version: v6.5.0
Edition: Community
Git Commit Hash: 706c3fa
Git Branch: heads/refs/tags/v6.5.0
UTC Build Time: 2022-12-27 03:50:44
GoVersion: go1.19.3
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: tikv |
The text was updated successfully, but these errors were encountered: