Debian Codegraph @

mysql-test/suite/group_replication/r/gr_consistent_reads_member_state.result

raw
1 include/group_replication.inc
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 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.
5 [connection server1]
6
7 ############################################################
8 # 01. Create two tables on each server before start the group.
9 [connection server1]
10 SET SESSION sql_log_bin = 0;
11 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY);
12 CREATE TABLE t2 (c1 INT NOT NULL PRIMARY KEY);
13 SET SESSION sql_log_bin = 1;
14 [connection server2]
15 SET SESSION sql_log_bin = 0;
16 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY);
17 CREATE TABLE t2 (c1 INT NOT NULL PRIMARY KEY);
18 INSERT INTO t2 VALUES (1);
19 call mtr.add_suppression("Replica SQL for channel 'group_replication_applier': Could not execute Write_rows event on table");
20 call mtr.add_suppression("Replica SQL for channel 'group_replication_applier': Worker [0-9] failed executing transaction*");
21 call mtr.add_suppression("Replica SQL for channel 'group_replication_applier': ... The replica coordinator and worker threads are stopped,*");
22 call mtr.add_suppression("The applier thread execution was aborted. Unable to process more transactions, this member will now leave the group.");
23 call mtr.add_suppression("Fatal error during execution on the Applier process of Group Replication. The server will now leave the group.");
24 call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
25 call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
26 SET SESSION sql_log_bin = 1;
27
28 ############################################################
29 # 02. Lock table t1 on server2 to block a future update.
30 [connection server_2]
31 LOCK table t1 READ;
32
33 ############################################################
34 # 03. Bootstrap group on server1.
35 [connection server1]
36 include/start_and_bootstrap_group_replication.inc
37
38 ############################################################
39 # 04. Execute transactions T1 on server1.
40 # T1 will block server2 on RECOVERING state.
41 [connection server1]
42 INSERT INTO t1 VALUES (1);
43
44 ############################################################
45 # 05. Start group on server2, it will be on RECOVERING state.
46 [connection server2]
47 include/start_group_replication.inc
48 SET @@SESSION.group_replication_consistency= 'BEFORE';
49 SELECT COUNT(*) AS count FROM t1;
50 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
51 BEGIN;
52 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
53 SELECT COUNT(*) AS count FROM t1;
54 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
55 COMMIT;
56 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
57 SET @@SESSION.group_replication_consistency= 'AFTER';
58 SELECT COUNT(*) AS count FROM t1;
59 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
60 BEGIN;
61 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
62 SELECT COUNT(*) AS count FROM t1;
63 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
64 COMMIT;
65 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
66 SET @@SESSION.group_replication_consistency= 'BEFORE_AND_AFTER';
67 SELECT COUNT(*) AS count FROM t1;
68 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
69 BEGIN;
70 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
71 SELECT COUNT(*) AS count FROM t1;
72 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
73 COMMIT;
74 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
75
76 ############################################################
77 # 06. Unlock table t1 on server2.
78 # Member will move to ONLINE state.
79 [connection server_2]
80 UNLOCK TABLES;
81 [connection server2]
82 include/gr_wait_for_member_state.inc
83 SET @@SESSION.group_replication_consistency= 'BEFORE';
84 SELECT COUNT(*) AS count FROM t1;
85 count
86 1
87 BEGIN;
88 SELECT COUNT(*) AS count FROM t1;
89 count
90 1
91 COMMIT;
92 SET @@SESSION.group_replication_consistency= 'AFTER';
93 SELECT COUNT(*) AS count FROM t1;
94 count
95 1
96 BEGIN;
97 SELECT COUNT(*) AS count FROM t1;
98 count
99 1
100 COMMIT;
101 SET @@SESSION.group_replication_consistency= 'BEFORE_AND_AFTER';
102 SELECT COUNT(*) AS count FROM t1;
103 count
104 1
105 BEGIN;
106 SELECT COUNT(*) AS count FROM t1;
107 count
108 1
109 COMMIT;
110
111 ############################################################
112 # 07. Execute transactions T2 on server1.
113 # T2 will make server2 move to ERROR state due to
114 # duplicate key.
115 [connection server1]
116 INSERT INTO t2 VALUES (1);
117 [connection server2]
118 include/gr_wait_for_member_state.inc
119 SET @@SESSION.group_replication_consistency= 'BEFORE';
120 SELECT COUNT(*) AS count FROM t1;
121 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
122 BEGIN;
123 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
124 SELECT COUNT(*) AS count FROM t1;
125 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
126 COMMIT;
127 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
128 SET @@SESSION.group_replication_consistency= 'AFTER';
129 SELECT COUNT(*) AS count FROM t1;
130 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
131 BEGIN;
132 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
133 SELECT COUNT(*) AS count FROM t1;
134 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
135 COMMIT;
136 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
137 SET @@SESSION.group_replication_consistency= 'BEFORE_AND_AFTER';
138 SELECT COUNT(*) AS count FROM t1;
139 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
140 BEGIN;
141 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
142 SELECT COUNT(*) AS count FROM t1;
143 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
144 COMMIT;
145 ERROR HY000: The option group_replication_consistency cannot be used on the current member state.
146
147 ############################################################
148 # 08. Stop group on server2.
149 # Member will move to OFFLINE state.
150 include/stop_group_replication.inc
151 include/gr_wait_for_member_state.inc
152 SET @@SESSION.group_replication_consistency= 'BEFORE';
153 SELECT COUNT(*) AS count FROM t1;
154 count
155 1
156 BEGIN;
157 SELECT COUNT(*) AS count FROM t1;
158 count
159 1
160 COMMIT;
161 SET @@SESSION.group_replication_consistency= 'AFTER';
162 SELECT COUNT(*) AS count FROM t1;
163 count
164 1
165 BEGIN;
166 SELECT COUNT(*) AS count FROM t1;
167 count
168 1
169 COMMIT;
170 SET @@SESSION.group_replication_consistency= 'BEFORE_AND_AFTER';
171 SELECT COUNT(*) AS count FROM t1;
172 count
173 1
174 BEGIN;
175 SELECT COUNT(*) AS count FROM t1;
176 count
177 1
178 COMMIT;
179 SET @@SESSION.group_replication_consistency= DEFAULT;
180
181 ############################################################
182 # 09. Clean up.
183 [connection server1]
184 DROP TABLE t1;
185 DROP TABLE t2;
186 [connection server2]
187 DROP TABLE t1;
188 DROP TABLE t2;
189 include/group_replication_end.inc