Debian Codegraph @

mysql-test/suite/group_replication/t/gr_start_stop_stress.test

raw
1 ################################################################################
2 # This test intends to stress Group Replication startup
3 # by starting and stopping without waiting for the member to come online
4 # as it is done classically in all other tests.
5 #
6 # Test:
7 # 0. The test requires three servers: M1, M2 and M3.
8 # 1. Bootstrap start a group on M1. Start GR on M2.
9 # 2. Create some transactions to ensure that recovery works fine.
10 # 3. Wait for all servers to be in sync.
11 # 4. Stress M3 by joining, leaving and joining again without waiting.
12 # 5. Start and assert check that M3 has recovered properly. Validate value of
13 # gtid_executed and data in the table.
14 # 6. Clean up.
15 ################################################################################
16 --source include/big_test.inc
17 --source include/not_valgrind.inc
18 --let $group_replication_group_name= 57006580-b202-11e4-ab27-0800200c9a66
19 --source include/have_group_replication_plugin.inc
20 --let $rpl_skip_group_replication_start= 1
21 --let $rpl_server_count= 3
22
23 --let $rpl_gtid_utils= 1
24 --source include/group_replication.inc
25
26 --echo #
27 --echo # Setup a new group
28 --echo #
29
30 --connection server1
31 --echo server1
32 --source include/start_and_bootstrap_group_replication.inc
33
34 --connection server2
35 --echo server2
36 --source include/start_group_replication.inc
37
38 --echo #
39 --echo # Create some transactions here to ensure that Recovery works fine in
40 --echo # the end
41 --echo #
42
43 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
44
45 INSERT INTO t1 VALUES (1);
46 INSERT INTO t1 VALUES (2);
47 INSERT INTO t1 VALUES (3);
48
49 --echo #
50 --echo # Wait for all servers to be in sync
51 --echo #
52 --source include/rpl_sync.inc
53
54 --connection server3
55 --echo server3
56
57 --echo #
58 --echo # Stress server 3 by joining, leaving and joining again without waiting
59 --echo #
60
61 --eval SET GLOBAL group_replication_group_name= "$group_replication_group_name"
62
63 --let $number_of_reps= 5
64
65 while($number_of_reps > 0) {
66 start group_replication;
67 stop group_replication;
68
69 --dec $number_of_reps
70 }
71
72 --echo #
73 --echo # Start and assert that server 3 has recovered properly
74 --echo #
75
76 --source include/start_group_replication.inc
77
78 --let $assert_text= GTID_EXECUTED must contain all group transactions
79 --let $assert_cond= GTID_IS_EQUAL(@@GLOBAL.GTID_EXECUTED, "$group_replication_group_name:1-12")
80 --source include/assert.inc
81
82 --echo #
83 --echo # Check that values are present
84 --echo #
85 SELECT * FROM t1;
86
87 --echo #
88 --echo # Cleanup and exit
89 --echo #
90
91 --connection server1
92 --echo server1
93
94 DROP TABLE t1;
95
96 --source include/group_replication_end.inc