File: rpl_sql_delay_multiple.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (88 lines) | stat: -rw-r--r-- 2,275 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#
# ==== Purpose ====
#
# This test checks if the sql delay is being applied in a multiple toplogy
# server_1->server_2,server_1->server_3.
#
# ==== Implementation ====
#
# The SQL_Delay is set to 5 seconds on one server_2 and to 8 seconds on
# server_3. For each for the six different transactions executed (two DDL,
# three DML and one multi-statement DML), the test verifies if the delay
# was the expected using replication timestamp infrastructure introduced
# by WL#7319.
#
# ==== References ====
#
# WL#7318 Delayed Replication: GTID based and relative to immediate master commit

--source include/have_debug.inc

--let $rpl_topology=1->2,1->3
--let $rpl_skip_start_slave= 1
--source include/rpl_init.inc

--let $delay_1= 5
--let $delay_2= 8
--let $slave_sleep= 1

--let $rpl_connection_name= server_2
--source include/rpl_connection.inc

--eval CHANGE REPLICATION SOURCE TO SOURCE_DELAY= $delay_1
source include/start_slave.inc;

--let $rpl_connection_name= server_3
--source include/rpl_connection.inc

--eval CHANGE REPLICATION SOURCE TO SOURCE_DELAY= $delay_2
source include/start_slave.inc;

--let $rpl_connection_name=server_1
--source include/rpl_connection.inc

CREATE TABLE t1 (a INT);
--let $trx_num= 1
--source extra/rpl_tests/check_slave_delay_multiple.inc

INSERT INTO t1 VALUES (1);
--let $trx_num= 2
--source extra/rpl_tests/check_slave_delay_multiple.inc

UPDATE t1 SET a=2;
--let $trx_num= 3
--source extra/rpl_tests/check_slave_delay_multiple.inc

DELETE FROM t1 WHERE a=2;
--let $trx_num= 4
--source extra/rpl_tests/check_slave_delay_multiple.inc

START TRANSACTION;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
COMMIT;

--let $trx_num= 5
--source extra/rpl_tests/check_slave_delay_multiple.inc

DROP TABLE t1;
--let $trx_num= 6
--source extra/rpl_tests/check_slave_delay_multiple.inc

# Cleanup
--let $rpl_connection_name= server_2
--source include/rpl_connection.inc

--source include/stop_slave_sql.inc
CHANGE REPLICATION SOURCE TO SOURCE_DELAY= 0;
--source include/start_slave_sql.inc

--let $rpl_connection_name= server_3
--source include/rpl_connection.inc

--source include/stop_slave_sql.inc
CHANGE REPLICATION SOURCE TO SOURCE_DELAY= 0;
--source include/start_slave_sql.inc

--source include/rpl_end.inc