-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed hang in concurrent DROP TABLE and BACKUP LOCK BLOCK_DDL
The problem was that tdc_remove_referenced_share() did not take into account that someone could push things into share->free_tables() even if there is a MDL_EXCLUSIVE lock on the table. This can happen if flush_tables() uses the table cache to flush a a non transactional table to disk.
- Loading branch information
Showing
4 changed files
with
72 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
create or replace table t1 (a int primary key, b int, c int, key(b),key(c)) engine=myisam; | ||
insert into t1 (a) values(1); | ||
set debug_sync='RESET'; | ||
connect con1, localhost, root,,; | ||
connect con2, localhost, root,,; | ||
connection default; | ||
backup stage start; | ||
backup stage flush; | ||
select * from t1; | ||
a b c | ||
1 NULL NULL | ||
set debug_sync='after_purge_tables SIGNAL parked WAIT_FOR go'; | ||
set debug_sync='before_tc_release_table SIGNAL parked2 WAIT_FOR go2'; | ||
backup stage BLOCK_DDL; | ||
connection con1; | ||
set debug_sync='now WAIT_FOR parked'; | ||
select * from t1; | ||
a b c | ||
1 NULL NULL | ||
set debug_sync='now SIGNAL go'; | ||
set debug_sync='now WAIT_FOR parked2'; | ||
set debug_sync='before_wait_for_refs SIGNAL waiting WAIT_FOR go3'; | ||
drop table t1;; | ||
connection con2; | ||
set debug_sync='now WAIT_FOR waiting'; | ||
set debug_sync='now SIGNAL go2'; | ||
set debug_sync='now SIGNAL go3'; | ||
connection default; | ||
connection con1; | ||
connection default; | ||
disconnect con1; | ||
disconnect con2; | ||
set debug_sync='RESET'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--source include/have_debug.inc | ||
|
||
create or replace table t1 (a int primary key, b int, c int, key(b),key(c)) engine=myisam; | ||
insert into t1 (a) values(1); | ||
|
||
set debug_sync='RESET'; | ||
connect (con1, localhost, root,,); | ||
connect (con2, localhost, root,,); | ||
connection default; | ||
|
||
backup stage start; | ||
backup stage flush; | ||
select * from t1; | ||
set debug_sync='after_purge_tables SIGNAL parked WAIT_FOR go'; | ||
set debug_sync='before_tc_release_table SIGNAL parked2 WAIT_FOR go2'; | ||
--send backup stage BLOCK_DDL | ||
--connection con1 | ||
set debug_sync='now WAIT_FOR parked'; | ||
select * from t1; | ||
set debug_sync='now SIGNAL go'; | ||
set debug_sync='now WAIT_FOR parked2'; | ||
set debug_sync='before_wait_for_refs SIGNAL waiting WAIT_FOR go3'; | ||
--send drop table t1; | ||
--connection con2 | ||
set debug_sync='now WAIT_FOR waiting'; | ||
set debug_sync='now SIGNAL go2'; | ||
set debug_sync='now SIGNAL go3'; | ||
--connection default | ||
--reap | ||
--connection con1 | ||
--reap | ||
connection default; | ||
disconnect con1; | ||
disconnect con2; | ||
set debug_sync='RESET'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters