| 1 |
# |
| 2 |
# ==== Purpose ==== |
| 3 |
# |
| 4 |
# This test checks if the sql delay is being applied in a multiple toplogy |
| 5 |
# server_1->server_2,server_1->server_3. |
| 6 |
# |
| 7 |
# ==== Implementation ==== |
| 8 |
# |
| 9 |
# The SQL_Delay is set to 5 seconds on one server_2 and to 8 seconds on |
| 10 |
# server_3. For each for the six different transactions executed (two DDL, |
| 11 |
# three DML and one multi-statement DML), the test verifies if the delay |
| 12 |
# was the expected using replication timestamp infrastructure introduced |
| 13 |
# by WL#7319. |
| 14 |
# |
| 15 |
# ==== References ==== |
| 16 |
# |
| 17 |
# WL#7318 Delayed Replication: GTID based and relative to immediate master commit |
| 18 |
|
| 19 |
--source include/have_debug.inc |
| 20 |
|
| 21 |
--let $rpl_topology=1->2,1->3 |
| 22 |
--let $rpl_skip_start_slave= 1 |
| 23 |
--source include/rpl_init.inc |
| 24 |
|
| 25 |
--let $delay_1= 5 |
| 26 |
--let $delay_2= 8 |
| 27 |
--let $slave_sleep= 1 |
| 28 |
|
| 29 |
--let $rpl_connection_name= server_2 |
| 30 |
--source include/rpl_connection.inc |
| 31 |
|
| 32 |
--eval CHANGE REPLICATION SOURCE TO SOURCE_DELAY= $delay_1 |
| 33 |
source include/start_slave.inc; |
| 34 |
|
| 35 |
--let $rpl_connection_name= server_3 |
| 36 |
--source include/rpl_connection.inc |
| 37 |
|
| 38 |
--eval CHANGE REPLICATION SOURCE TO SOURCE_DELAY= $delay_2 |
| 39 |
source include/start_slave.inc; |
| 40 |
|
| 41 |
--let $rpl_connection_name=server_1 |
| 42 |
--source include/rpl_connection.inc |
| 43 |
|
| 44 |
CREATE TABLE t1 (a INT); |
| 45 |
--let $trx_num= 1 |
| 46 |
--source extra/rpl_tests/check_slave_delay_multiple.inc |
| 47 |
|
| 48 |
INSERT INTO t1 VALUES (1); |
| 49 |
--let $trx_num= 2 |
| 50 |
--source extra/rpl_tests/check_slave_delay_multiple.inc |
| 51 |
|
| 52 |
UPDATE t1 SET a=2; |
| 53 |
--let $trx_num= 3 |
| 54 |
--source extra/rpl_tests/check_slave_delay_multiple.inc |
| 55 |
|
| 56 |
DELETE FROM t1 WHERE a=2; |
| 57 |
--let $trx_num= 4 |
| 58 |
--source extra/rpl_tests/check_slave_delay_multiple.inc |
| 59 |
|
| 60 |
START TRANSACTION; |
| 61 |
INSERT INTO t1 VALUES (1); |
| 62 |
INSERT INTO t1 VALUES (2); |
| 63 |
INSERT INTO t1 VALUES (3); |
| 64 |
COMMIT; |
| 65 |
|
| 66 |
--let $trx_num= 5 |
| 67 |
--source extra/rpl_tests/check_slave_delay_multiple.inc |
| 68 |
|
| 69 |
DROP TABLE t1; |
| 70 |
--let $trx_num= 6 |
| 71 |
--source extra/rpl_tests/check_slave_delay_multiple.inc |
| 72 |
|
| 73 |
# Cleanup |
| 74 |
--let $rpl_connection_name= server_2 |
| 75 |
--source include/rpl_connection.inc |
| 76 |
|
| 77 |
--source include/stop_slave_sql.inc |
| 78 |
CHANGE REPLICATION SOURCE TO SOURCE_DELAY= 0; |
| 79 |
--source include/start_slave_sql.inc |
| 80 |
|
| 81 |
--let $rpl_connection_name= server_3 |
| 82 |
--source include/rpl_connection.inc |
| 83 |
|
| 84 |
--source include/stop_slave_sql.inc |
| 85 |
CHANGE REPLICATION SOURCE TO SOURCE_DELAY= 0; |
| 86 |
--source include/start_slave_sql.inc |
| 87 |
|
| 88 |
--source include/rpl_end.inc |