-
Notifications
You must be signed in to change notification settings - Fork 713
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix high_priority_ddl from timing out
Summary: When high_priority_ddl is used, it is possible for the lock acquisition to timeout. Before the connections are killed, m_wait.timed_wait() is called with set_status_on_timeout. Once the status is set, even if the lock frees up, it won't be granted to the pending mdl_ticket. The existing code resets m_wait status before killing the other connections, but if the lock is granted before m_wait is reset, then the grant fails and the ddl still times out. The solution is to prevent m_wait from being set to timeout before the kill connection occurs. Then it never needs to be reset. Reviewed By: yashtc Differential Revision: D6744017 fbshipit-source-id: f598ab4
- Loading branch information
1 parent
b9f2256
commit f816fee
Showing
3 changed files
with
58 additions
and
13 deletions.
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,9 @@ | ||
CREATE TABLE t1 (a int) engine=InnoDB; | ||
BEGIN; | ||
INSERT INTO t1 values (1); | ||
set high_priority_ddl=1; | ||
set debug_sync='mdl_high_priority_kill_conflicting_locks SIGNAL parked WAIT_FOR go'; | ||
ALTER TABLE t1 rename new_t1; | ||
set debug_sync='now WAIT_FOR parked'; | ||
set debug_sync='now SIGNAL go'; | ||
DROP TABLE new_t1; |
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,28 @@ | ||
--source include/have_innodb.inc | ||
--source include/have_debug_sync.inc | ||
|
||
CREATE TABLE t1 (a int) engine=InnoDB; | ||
|
||
connect(con1,localhost,root,,); | ||
BEGIN; | ||
INSERT INTO t1 values (1); | ||
|
||
connect(con2,localhost,root,,); | ||
|
||
set high_priority_ddl=1; | ||
set debug_sync='mdl_high_priority_kill_conflicting_locks SIGNAL parked WAIT_FOR go'; | ||
send ALTER TABLE t1 rename new_t1; | ||
|
||
connection default; | ||
|
||
let $count_sessions = 2; | ||
--source include/wait_until_count_sessions.inc | ||
|
||
set debug_sync='now WAIT_FOR parked'; | ||
set debug_sync='now SIGNAL go'; | ||
let $wait_condition= select count(*) > 0 from information_schema.tables where table_name = 'new_t1'; | ||
--source include/wait_condition.inc | ||
|
||
DROP TABLE new_t1; | ||
|
||
disconnect con2; |
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