| 1 |
# The test verifies that the FLUSH TABLES WITH READ LOCK does not |
| 2 |
# time out if it needs to wait for another MDL lock for short duration |
| 3 |
# during SST donation. |
| 4 |
|
| 5 |
--source include/galera_cluster.inc |
| 6 |
--source include/have_debug.inc |
| 7 |
--source include/have_debug_sync.inc |
| 8 |
|
| 9 |
--let $node_1 = node_1 |
| 10 |
--let $node_2 = node_2 |
| 11 |
--source include/auto_increment_offset_save.inc |
| 12 |
|
| 13 |
--let $galera_connection_name = node_1_ctrl |
| 14 |
--let $galera_server_number = 1 |
| 15 |
--source include/galera_connect.inc |
| 16 |
|
| 17 |
# |
| 18 |
# Run UPDATE on node_1 and make it block before table locks are taken. |
| 19 |
# This should block FTWRL. |
| 20 |
# |
| 21 |
--connection node_1 |
| 22 |
CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 INT); |
| 23 |
INSERT INTO t1 VALUES (1, 1); |
| 24 |
SET DEBUG_SYNC = "before_lock_tables_takes_lock SIGNAL sync_point_reached WAIT_FOR sync_point_continue"; |
| 25 |
--send UPDATE t1 SET f2 = 2 WHERE f1 = 1 |
| 26 |
|
| 27 |
--connection node_1_ctrl |
| 28 |
SET DEBUG_SYNC = "now WAIT_FOR sync_point_reached"; |
| 29 |
|
| 30 |
# |
| 31 |
# Restart node_2, force SST. |
| 32 |
# |
| 33 |
--connection node_2 |
| 34 |
--source include/shutdown_mysqld.inc |
| 35 |
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat |
| 36 |
# Restart without waiting. The UPDATE should block FTWRL on node_1, |
| 37 |
# so the SST cannot be completed and node_2 cannot join before |
| 38 |
# UPDATE connection is signalled to continue. |
| 39 |
--write_line "restart:$start_mysqld_params" $_expect_file_name |
| 40 |
# If the bug is present, FTWRL times out on node_1 in couple of |
| 41 |
# seconds and node_2 fails to join. |
| 42 |
|
| 43 |
--connection node_1_ctrl |
| 44 |
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment' and VARIABLE_VALUE = 'Donor/Desynced' |
| 45 |
--source include/wait_condition.inc |
| 46 |
--echo # Node should be in Donor/Desynced state as node_2 has not yet joined |
| 47 |
SHOW STATUS LIKE 'wsrep_local_state_comment'; |
| 48 |
SET DEBUG_SYNC = "now SIGNAL sync_point_continue"; |
| 49 |
|
| 50 |
--connection node_1 |
| 51 |
--reap |
| 52 |
SET DEBUG_SYNC = "RESET"; |
| 53 |
|
| 54 |
--connection node_2 |
| 55 |
--enable_reconnect |
| 56 |
--source include/wait_until_connected_again.inc |
| 57 |
|
| 58 |
--connection node_1 |
| 59 |
DROP TABLE t1; |
| 60 |
|
| 61 |
--source include/auto_increment_offset_restore.inc |
| 62 |
--source include/galera_end.inc |