1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-28930 ALTER TABLE Deadlocks with parallel TL_WRITE

ALTER ONLINE TABLE acquires table with TL_READ. Myisam normally acquires
TL_WRITE for DML, which makes it hang until table is freed.

We deadlock once ALTER upgrades its MDL lock.

Solution:
Unlock table earlier. We don't need to hold TL_READ once we finished
copying. Relay log replication requires no data locks on `from` table.
This commit is contained in:
Nikita Malyavin
2022-06-29 20:16:19 +03:00
committed by Sergei Golubchik
parent 8fbdc76038
commit 2ed03a41e6
5 changed files with 65 additions and 9 deletions

View File

@ -75,17 +75,15 @@ stage/sql/table lock NULL NULL
stage/sql/After create NULL NULL
stage/sql/copy to tmp table 5 5
stage/sql/Enabling keys NULL NULL
stage/sql/Unlocking tables NULL NULL
stage/sql/Enabling keys NULL NULL
stage/sql/Apply log event NULL NULL
stage/sql/After apply log event NULL NULL
stage/sql/Rename result table NULL NULL
stage/sql/Unlocking tables NULL NULL
stage/sql/Rename result table NULL NULL
stage/sql/End of update loop NULL NULL
stage/sql/Query end NULL NULL
stage/sql/Commit NULL NULL
stage/sql/closing tables NULL NULL
stage/sql/Unlocking tables NULL NULL
stage/sql/closing tables NULL NULL
stage/sql/Commit implicit NULL NULL
stage/sql/Starting cleanup NULL NULL
stage/sql/Freeing items NULL NULL