mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
MDEV-29566 parts.partition_special_innodb unstable DROP TABLE fix
The test sporadically fails with ER_LOCK_WAIT_TIMEOUT on DROP TABLE t1 of the Bug#53676 test case (see MDEV-29566). mysqltest: At line 119: query 'DROP TABLE t1' failed: ER_LOCK_WAIT_TIMEOUT (1205): Lock wait timeout exceeded; try restarting transaction The DROP TABLE is executed by con2 with lock_wait_timeout=0. The INSERT puts two rows into each partition, which exceeds the auto recalc threshold of persistent statistics, so the partitions are added to the recalc pool. The statistics background thread opens the partitions with a shared MDL on t1, and if it does so at the moment of DROP TABLE, the MDL request fails instantly. The fix creates the table with STATS_PERSISTENT=0. The test case is not about statistics; this also avoids locking mysql.innodb_table_stats and mysql.innodb_index_stats in ha_innobase::delete_table() when the failed ALTER TABLE ... ADD PARTITION rolls back the new partitions.
This commit is contained in:
@@ -232,7 +232,7 @@ DROP TABLE t1;
|
||||
# Bug#53676: Unexpected errors and possible table corruption on
|
||||
# ADD PARTITION and LOCK TABLE
|
||||
CREATE TABLE t1 ( i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f INT )
|
||||
ENGINE = InnoDB PARTITION BY HASH(i) PARTITIONS 2;
|
||||
ENGINE = InnoDB STATS_PERSISTENT=0 PARTITION BY HASH(i) PARTITIONS 2;
|
||||
INSERT INTO t1 VALUES (2, 2), (3, 3), (4, 4), (5, 5);
|
||||
LOCK TABLE t1 READ;
|
||||
connect con2,localhost,root,,;
|
||||
|
||||
@@ -78,8 +78,9 @@ DROP TABLE t1;
|
||||
--echo #
|
||||
--echo # Bug#53676: Unexpected errors and possible table corruption on
|
||||
--echo # ADD PARTITION and LOCK TABLE
|
||||
# Avoid a MDL conflict between statistics recalc and the DROP TABLE below
|
||||
CREATE TABLE t1 ( i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f INT )
|
||||
ENGINE = InnoDB PARTITION BY HASH(i) PARTITIONS 2;
|
||||
ENGINE = InnoDB STATS_PERSISTENT=0 PARTITION BY HASH(i) PARTITIONS 2;
|
||||
INSERT INTO t1 VALUES (2, 2), (3, 3), (4, 4), (5, 5);
|
||||
|
||||
LOCK TABLE t1 READ;
|
||||
|
||||
Reference in New Issue
Block a user