File: gr_replicate_group_to_group.result

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 (154 lines) | stat: -rw-r--r-- 7,088 bytes parent folder | download | duplicates (2)
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
include/group_replication.inc [rpl_server_count=6]
Warnings:
Note	####	Sending passwords in plain text without SSL/TLS is extremely insecure.
Note	####	Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
[connection server1]

#################################################################
#  1. Setup Group Replication on M1 and M2 and create group GR1.
SET @@GLOBAL.group_replication_group_seeds= "";
include/start_and_bootstrap_group_replication.inc
SET @@GLOBAL.group_replication_group_seeds= "GROUP_REPLICATION_GROUP_SEEDS";
include/start_group_replication.inc
include/rpl_gr_wait_for_number_of_members.inc

#################################################################
#  2. Setup Group Replication on M1 and M2 and create group GR2.
SET @@GLOBAL.group_replication_group_seeds= "";
include/start_and_bootstrap_group_replication.inc
SET @@GLOBAL.group_replication_group_seeds= "GROUP_REPLICATION_GROUP_SEEDS";
include/start_group_replication.inc
include/rpl_gr_wait_for_number_of_members.inc

###############################################################
#  3. Setup a asynchronous replication connection from M3 (GR2)
#     to M1 (GR1).
CHANGE REPLICATION SOURCE TO SOURCE_HOST="127.0.0.1", SOURCE_USER="root", SOURCE_PASSWORD="", SOURCE_PORT=SERVER_3_PORT, SOURCE_AUTO_POSITION=1;
Warnings:
Note	1759	Sending passwords in plain text without SSL/TLS is extremely insecure.
Note	1760	Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
include/start_slave.inc

###############################################################
#  4. Setup a asynchronous replication connection from M1 (GR1)
#     to M3 (GR2).
CHANGE REPLICATION SOURCE TO SOURCE_HOST="127.0.0.1", SOURCE_USER="root", SOURCE_PASSWORD="", SOURCE_PORT=SERVER_1_PORT, SOURCE_AUTO_POSITION=1;
Warnings:
Note	1759	Sending passwords in plain text without SSL/TLS is extremely insecure.
Note	1760	Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
include/start_slave.inc

###############################################################
#  5. Test view change issue by adding/dropping nodes from the
#     groups (just to generate more VIEW_EVENTs).
# 5.1. Add a node M5 to group (GR1).
SET @@GLOBAL.group_replication_group_seeds= "GROUP_REPLICATION_GROUP_SEEDS";
include/start_group_replication.inc
include/rpl_gr_wait_for_number_of_members.inc

################################################################
# 5.2. Add and immediately drop a node M6 to group (GR2).
SET @@GLOBAL.group_replication_group_seeds= "GROUP_REPLICATION_GROUP_SEEDS";
include/start_group_replication.inc
include/rpl_gr_wait_for_number_of_members.inc
include/stop_group_replication.inc

############################################################
#  6. Execute some transactions on M3 (GR2).
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (0);
INSERT INTO t1 VALUES (1);
UPDATE t1 SET c1=2 WHERE c1=0;
DELETE FROM t1 WHERE c1=1;

############################################################
#  7. Wait until transactions executed on M3 are applied
#     on all nodes in both groups.
include/sync_slave_sql_with_master.inc
include/sync_slave_sql_with_master.inc
include/sync_slave_sql_with_master.inc
include/sync_slave_sql_with_master.inc

############################################################
#  8. Execute some transactions on M1 (GR1).
CREATE TABLE t2 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t2 VALUES (0);
INSERT INTO t2 VALUES (1);
UPDATE t2 SET c1=2 WHERE c1=0;
DELETE FROM t2 WHERE c1=1;

############################################################
#  9. Wait until transactions executed on M1 are applied
#     on all nodes in both groups.
include/sync_slave_sql_with_master.inc
include/sync_slave_sql_with_master.inc
include/sync_slave_sql_with_master.inc
include/sync_slave_sql_with_master.inc

#########################################################################
# 10. Validate data on all nodes (M1, M2, M3, M4 and M5)
include/diff_tables.inc [server_1:t1, server_2:t1, server_3:t1, server_4:t1, server_5:t1]
include/diff_tables.inc [server_1:t2, server_2:t2, server_3:t2, server_4:t2, server_5:t2]

#########################################################################
# 11. Check that GTID_EXECUTED on all servers are as expected.
SET SESSION sql_log_bin= 0;
include/gtid_utils.inc
SET SESSION sql_log_bin= 1;
include/assert.inc [Check that GTID_EXECUTED set on all servers are as expected.]
SET SESSION sql_log_bin= 0;
include/gtid_utils_end.inc
SET SESSION sql_log_bin= 1;
SET SESSION sql_log_bin= 0;
include/gtid_utils.inc
SET SESSION sql_log_bin= 1;
include/assert.inc [Check that GTID_EXECUTED set on all servers are as expected.]
SET SESSION sql_log_bin= 0;
include/gtid_utils_end.inc
SET SESSION sql_log_bin= 1;
SET SESSION sql_log_bin= 0;
include/gtid_utils.inc
SET SESSION sql_log_bin= 1;
include/assert.inc [Check that GTID_EXECUTED set on all servers are as expected.]
SET SESSION sql_log_bin= 0;
include/gtid_utils_end.inc
SET SESSION sql_log_bin= 1;
SET SESSION sql_log_bin= 0;
include/gtid_utils.inc
SET SESSION sql_log_bin= 1;
include/assert.inc [Check that GTID_EXECUTED set on all servers are as expected.]
SET SESSION sql_log_bin= 0;
include/gtid_utils_end.inc
SET SESSION sql_log_bin= 1;
SET SESSION sql_log_bin= 0;
include/gtid_utils.inc
SET SESSION sql_log_bin= 1;
include/assert.inc [Check that GTID_EXECUTED set on all servers are as expected.]
SET SESSION sql_log_bin= 0;
include/gtid_utils_end.inc
SET SESSION sql_log_bin= 1;

############################################################
#  12. Clean data.
DROP TABLE t1;
DROP TABLE t2;
include/sync_slave_sql_with_master.inc
include/sync_slave_sql_with_master.inc
include/sync_slave_sql_with_master.inc
include/sync_slave_sql_with_master.inc

##############################################################
# 13. Stop asynchronous replication between M3->M1 and M1->M3.
include/stop_slave.inc
CHANGE REPLICATION SOURCE TO SOURCE_AUTO_POSITION=0 FOR CHANNEL "";
include/stop_slave.inc
CHANGE REPLICATION SOURCE TO SOURCE_AUTO_POSITION=0 FOR CHANNEL "";

############################################################
# 14. Stop Group Replication on all 5 nodes.
include/stop_group_replication.inc
include/stop_group_replication.inc
include/stop_group_replication.inc
include/stop_group_replication.inc
include/stop_group_replication.inc
include/group_replication_end.inc