Thread pool and lock tables cause deadlock
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.5 |
Won't Fix
|
Undecided
|
Laurynas Biveinis | |||
5.6 |
Fix Released
|
High
|
Laurynas Biveinis | |||
5.7 |
Fix Released
|
High
|
Laurynas Biveinis |
Bug Description
MySQL settings:
[mysqld]
thread_handling = pool-of-threads
extra_port = 3307
Create test table:
create table test;
create database mysqlslap;
create table test.a (a int) engine=innodb;
insert into test.a values (1),(2)
Two mysqlslap processes running in parallel:
mysqlslap --concurrency=100 --iterations=
cat cre_simple.sql
delimiter ;;
lock tables test.a write;;
drop trigger if exists a_insert;;
create definer=
UPDATE test.a SET a.a = NEW.a + 1 WHERE a.a = NEW.a;
end;;
unlock tables;;
delimiter ;
Execute create trigger several times until stale:
mysql test < cre_simple.sql
Lock tables is seems to be important (I wasn't able to reproduce the issue without lock tables for write.
extra_port and performance schema allows to see that select queries are awaiting for metadata lock, but the thread re-creating trigger is inactive.
I was able to reproduce this instance with latest PS 5.6 & 5.7
description: | updated |
Create trigger is not required for reproduction, lock/unlock tables are enough.