| 1 |
# This file purpose is to set up node 4 to require SST which is artificaially |
| 2 |
# prolonged and as a result accumulate sufficient relication queue. |
| 3 |
# The contents of the qeuee are controlled in the sourcing test files. |
| 4 |
|
| 5 |
--source include/galera_cluster.inc |
| 6 |
--source include/big_test.inc |
| 7 |
--source include/have_debug.inc |
| 8 |
--source include/have_debug_sync.inc |
| 9 |
|
| 10 |
# Make sure that the test is operating on the right version of galera library. |
| 11 |
--let $galera_version=26.4.19 |
| 12 |
source ../wsrep/include/check_galera_version.inc; |
| 13 |
|
| 14 |
--let $node_1=node_1 |
| 15 |
--let $node_2=node_2 |
| 16 |
--let $node_3=node_3 |
| 17 |
--let $node_4=node_4 |
| 18 |
--source ../include/auto_increment_offset_save.inc |
| 19 |
|
| 20 |
# create table t1 and procedure p1 to generate wirtesets |
| 21 |
--connection node_1 |
| 22 |
CREATE TABLE t1(pk INT AUTO_INCREMENT PRIMARY KEY); |
| 23 |
|
| 24 |
DELIMITER |; |
| 25 |
CREATE PROCEDURE p1(IN max INT) |
| 26 |
BEGIN |
| 27 |
DECLARE i INT; |
| 28 |
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; |
| 29 |
|
| 30 |
SET i = 0; |
| 31 |
WHILE i < max DO |
| 32 |
INSERT IGNORE INTO t1 VALUES (DEFAULT); |
| 33 |
SET i = i + 1; |
| 34 |
END WHILE; |
| 35 |
END| |
| 36 |
DELIMITER ;| |
| 37 |
|
| 38 |
# 130 events move the commit cut, it is essential in voting |
| 39 |
CALL p1(130); |
| 40 |
|
| 41 |
--connection node_4 |
| 42 |
--echo Shutting down server 4... |
| 43 |
--let $node_4_server_id= `SELECT @@server_id` |
| 44 |
--let $node_4_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$node_4_server_id.expect |
| 45 |
--let $node_4_pid_file= `SELECT @@pid_file` |
| 46 |
--source include/shutdown_mysqld.inc |
| 47 |
# enforce SST |
| 48 |
--exec rm -rf $MYSQLTEST_VARDIR/mysqld.4/data/grastate.dat |
| 49 |
|
| 50 |
# Wait for node #4 to leave cluster |
| 51 |
--connection node_1 |
| 52 |
--let $members = 3 |
| 53 |
--source include/wsrep_wait_membership.inc |
| 54 |
|
| 55 |
# prepare to stop SST donor thread when node is in donor state |
| 56 |
SET GLOBAL debug = "+d,sync.wsrep_donor_state"; |
| 57 |
|
| 58 |
--connection node_4 |
| 59 |
--echo Restarting server 4... |
| 60 |
# Need to use this form instead of start_mysqld.inc because the latter is blocking |
| 61 |
--exec echo "restart:$start_mysqld_params" > $node_4_expect_file_name |
| 62 |
|
| 63 |
# Wait for node #1 to become a donor |
| 64 |
--connection node_1 |
| 65 |
SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_donor_state_reached"; |
| 66 |
--echo Tables on server 1 flushed and locked for SST to server 4 |
| 67 |
SET SESSION DEBUG_SYNC = "now SIGNAL signal.wsrep_donor_state"; |
| 68 |
SET GLOBAL debug = ""; |
| 69 |
SET DEBUG_SYNC='RESET'; |
| 70 |
|
| 71 |
--echo Wait for the state snapshot to be copied to server 4 |
| 72 |
--source include/galera_wait_ready.inc |
| 73 |
--echo SST script unlocked server 1 |
| 74 |
|
| 75 |
# |
| 76 |
# At this point state snapshot has been copied, node 1 is operational and |
| 77 |
# we have about 20 seconds while everything we do will go into the replication |
| 78 |
# queue on node 4 which it will have to apply on top of the snapshot. |
| 79 |
# |