| 1 |
|
| 2 |
--connection node_2 |
| 3 |
SET GLOBAL DEBUG_DBUG = '+d,sync.wsrep_apply_toi'; |
| 4 |
|
| 5 |
--connection node_1 |
| 6 |
--eval $fk_parent_query |
| 7 |
|
| 8 |
--connection node_2 |
| 9 |
SET DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_toi_reached"; |
| 10 |
SET SESSION wsrep_sync_wait = 0; |
| 11 |
|
| 12 |
# |
| 13 |
# Execute child query on node_1. |
| 14 |
# If bug is present, expect the wait condition |
| 15 |
# to timeout and when the child query applies, it |
| 16 |
# will be granted a MDL lock on parent table. |
| 17 |
# When resumed, the parent query will |
| 18 |
# also try to acquire MDL lock on parent table, |
| 19 |
# causing a BF-BF conflict on that MDL lock. |
| 20 |
# |
| 21 |
--connection node_1 |
| 22 |
START TRANSACTION; |
| 23 |
--eval $fk_child_query |
| 24 |
--let $wait_condition = SELECT COUNT(*) = $fk_mdl_lock_num FROM performance_schema.metadata_locks WHERE OBJECT_SCHEMA='test' AND LOCK_STATUS="GRANTED" |
| 25 |
--source include/wait_condition.inc |
| 26 |
COMMIT; |
| 27 |
|
| 28 |
|
| 29 |
--connection node_2 |
| 30 |
SET GLOBAL DEBUG_DBUG = '-d,sync.wsrep_apply_toi'; |
| 31 |
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_toi"; |
| 32 |
|
| 33 |
|
| 34 |
# |
| 35 |
# Cleanup |
| 36 |
# |
| 37 |
SET DEBUG_SYNC = 'RESET'; |
| 38 |
SET GLOBAL DEBUG_DBUG = ""; |
| 39 |
SET GLOBAL wsrep_slave_threads=DEFAULT; |
| 40 |
|
| 41 |
--connection node_1 |
| 42 |
SET DEBUG_SYNC = 'RESET'; |
| 43 |
SET GLOBAL DEBUG_DBUG = ""; |
| 44 |
SET GLOBAL wsrep_slave_threads=DEFAULT; |