File: gr_multiple_groups_with_same_name.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 (84 lines) | stat: -rw-r--r-- 3,492 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
################################################################################
# Verify that multiple groups are possible with same group name.
#
# Test:
# 0. The test requires three servers.
# 1. Bootstrap start GR on three servers.
# 2. Verify that three groups with one member on each group with same group name
#    are formed.
# 3. Upon restarting GR without bootstrap on server2 and server3. Only one group
#    with three members will be formed.
################################################################################

--source include/big_test.inc
--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--let $rpl_server_count= 3
--source include/group_replication.inc

--let $rpl_connection_name= server1
--source include/rpl_connection.inc
# Bootstrap start GR on server1.
--source include/start_and_bootstrap_group_replication.inc
--let $group_name_server1 = `SELECT @@GLOBAL.group_replication_group_name`
--echo #
--echo # Check that group with one member is formed.
SELECT CHANNEL_NAME, MEMBER_STATE, COUNT(*) AS COUNT from performance_schema.replication_group_members GROUP BY CHANNEL_NAME, MEMBER_STATE;

--let $rpl_connection_name= server2
--source include/rpl_connection.inc
# Start GR on server2.
--source include/start_group_replication.inc
--echo #
--echo # Check that group now have two members.
SELECT CHANNEL_NAME, MEMBER_STATE, COUNT(*) AS COUNT from performance_schema.replication_group_members GROUP BY CHANNEL_NAME, MEMBER_STATE;
# Stop GR on server2.
--source include/stop_group_replication.inc
# To reset the GTID_EXECUTED.
RESET MASTER;

# Bootstrap start GR on server2.
--source include/start_and_bootstrap_group_replication.inc
--let $group_name_server2 = `SELECT @@GLOBAL.group_replication_group_name`
--echo #
--echo # Check that group with one member is formed.
SELECT CHANNEL_NAME, MEMBER_STATE, COUNT(*) AS COUNT from performance_schema.replication_group_members GROUP BY CHANNEL_NAME, MEMBER_STATE;

--let $rpl_connection_name= server3
--source include/rpl_connection.inc
# Bootstrap start GR on server3.
--source include/start_and_bootstrap_group_replication.inc
--let $group_name_server3 = `SELECT @@GLOBAL.group_replication_group_name`
--echo #
--echo # Check that group with one member is formed.
SELECT CHANNEL_NAME, MEMBER_STATE, COUNT(*) AS COUNT from performance_schema.replication_group_members GROUP BY CHANNEL_NAME, MEMBER_STATE;

--echo #
--echo # Verify that group name is same on all the three servers.
--let $assert_text= Verify same group name on server1 and server2
--let $assert_cond= "$group_name_server1" = "$group_name_server2"
--source include/assert.inc

--let $assert_text= Verify same group name on server1 and server3
--let $assert_cond= "$group_name_server1" = "$group_name_server3"
--source include/assert.inc

# Stop GR on server3.
--source include/stop_group_replication.inc

--echo #
--echo # Restart GR (not bootstrap) on server2 and server3.
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--source include/stop_group_replication.inc
--source include/start_group_replication.inc

--let $rpl_connection_name= server3
--source include/rpl_connection.inc
--source include/start_group_replication.inc

--echo #
--echo # Check that group with three members is formed.
SELECT CHANNEL_NAME, MEMBER_STATE, COUNT(*) AS COUNT from performance_schema.replication_group_members GROUP BY CHANNEL_NAME, MEMBER_STATE;

--source include/group_replication_end.inc