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