File: gr_start_stop_stress.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 (96 lines) | stat: -rw-r--r-- 2,557 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
89
90
91
92
93
94
95
96
################################################################################
# This test intends to stress Group Replication startup
# by starting and stopping without waiting for the member to come online
# as it is done classically in all other tests.
#
# Test:
# 0. The test requires three servers: M1, M2 and M3.
# 1. Bootstrap start a group on M1. Start GR on M2.
# 2. Create some transactions to ensure that recovery works fine.
# 3. Wait for all servers to be in sync.
# 4. Stress M3 by joining, leaving and joining again without waiting.
# 5. Start and assert check that M3 has recovered properly. Validate value of
#    gtid_executed and data in the table.
# 6. Clean up.
################################################################################
--source include/big_test.inc
--source include/not_valgrind.inc
--let $group_replication_group_name= 57006580-b202-11e4-ab27-0800200c9a66
--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--let $rpl_server_count= 3

--let $rpl_gtid_utils= 1
--source include/group_replication.inc

--echo #
--echo # Setup a new group
--echo #

--connection server1
--echo server1
--source include/start_and_bootstrap_group_replication.inc

--connection server2
--echo server2
--source include/start_group_replication.inc

--echo #
--echo # Create some transactions here to ensure that Recovery works fine in
--echo # the end
--echo #

CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;

INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);

--echo #
--echo # Wait for all servers to be in sync
--echo #
--source include/rpl_sync.inc

--connection server3
--echo server3

--echo #
--echo # Stress server 3 by joining, leaving and joining again without waiting
--echo #

--eval SET GLOBAL group_replication_group_name= "$group_replication_group_name"

--let $number_of_reps= 5

while($number_of_reps > 0) {
  start group_replication;
  stop group_replication;

  --dec $number_of_reps
}

--echo #
--echo # Start and assert that server 3 has recovered properly
--echo #

--source include/start_group_replication.inc

--let $assert_text= GTID_EXECUTED must contain all group transactions
--let $assert_cond= GTID_IS_EQUAL(@@GLOBAL.GTID_EXECUTED, "$group_replication_group_name:1-12")
--source include/assert.inc

--echo #
--echo # Check that values are present
--echo #
SELECT * FROM t1;

--echo #
--echo # Cleanup and exit
--echo #

--connection server1
--echo server1

DROP TABLE t1;

--source include/group_replication_end.inc