Debian Codegraph @

mysql-test/suite/group_replication/r/gr_primary_key_on_invisible_column_conflict.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 # 1. With both members ONLINE. Create a table on M1.
8
9 [connection server1]
10 CREATE TABLE t1 (c1 INT PRIMARY KEY INVISIBLE, c2 INT);
11 SELECT * FROM t1;
12 c2
13 SELECT c1, c2 FROM t1;
14 c1 c2
15 include/rpl_sync.inc
16
17 # 2. Checking the negative case in which there is a conflict.
18
19
20 ############################################################
21 # 0. Initial setup and checks.
22 [connection server1]
23 SET SESSION sql_log_bin= 0;
24 include/gtid_utils.inc
25 SET SESSION sql_log_bin= 1;
26 include/gtid_step_reset.inc
27
28 ############################################################
29 # 1. Set a debug sync before broadcast message to group on
30 # connection local_server_connection1.
31 [connection server1]
32 SET @debug_save= @@GLOBAL.DEBUG;
33 SET @@GLOBAL.DEBUG='d,group_replication_before_message_broadcast';
34
35 #####################################################################
36 # 2. Commit local_transaction that will be blocked before broadcast.
37 BEGIN;
38 INSERT INTO t1 (c1, c2) VALUES (1, 10);
39 COMMIT;
40
41 ############################################################
42 # 3. Wait until local transaction reaches the
43 # group_replication_before_message_broadcast debug sync point.
44 [connection server_1]
45
46 ############################################################
47 # 4. Execute a transaction on remote server, that will reach first
48 # certification, since transaction on the local server
49 # is blocked before broadcast.
50 [connection server2]
51 BEGIN;
52 INSERT INTO t1 (c1, c2) VALUES (1, 20);
53 COMMIT;
54
55 ############################################################
56 # 5. Signal the waiting thread on local server to resume the
57 # transaction.
58 [connection server_1]
59 SET DEBUG_SYNC='now SIGNAL waiting';
60 SET @@GLOBAL.DEBUG= @debug_save;
61
62 ############################################################
63 # 6. Wait for remote transaction to be executed succesfully
64 on local server.
65 [connection server2]
66 include/sync_slave_sql_with_master.inc
67 ############################################################
68 # 7. If the test case is conflict scenario, local transaction
69 # will end up in an error stating that it was aborted,
70 # since transactions are conflicting and transaction on
71 # remote server was ordered first. If the test case is
72 # is positive scenario, no error will be seen here.
73 [connection server1]
74 ERROR 40000: Plugin instructed the server to rollback the current transaction.
75 [connection server1]
76 SET @@GLOBAL.DEBUG=@debug_save;
77 ############################################################
78 # 8. Sync everything
79 include/rpl_sync.inc
80 ############################################################
81 # 9. Assert that number of certified transactions are the
82 # expected ones.
83 include/assert.inc [The value of Count_Transactions_Checked should be 3 after starting group replication]
84 include/assert.inc [The value of Count_Conflicts_Detected should be 1 after starting group replication]
85 ############################################################
86 # 10. Assert that GTID is increased as expected
87 include/gtid_step_assert.inc [count=1, only_count=1]
88 [connection server1]
89 SET SESSION sql_log_bin= 0;
90 include/gtid_utils_end.inc
91 SET SESSION sql_log_bin= 1;
92 ############################################################
93 # 11. Cleanup (restore the connection back to original)
94 [connection server1]
95
96 # 3. Checking the positive case in which there is no conflict.
97
98
99 ############################################################
100 # 0. Initial setup and checks.
101 [connection server1]
102 SET SESSION sql_log_bin= 0;
103 include/gtid_utils.inc
104 SET SESSION sql_log_bin= 1;
105 include/gtid_step_reset.inc
106
107 ############################################################
108 # 1. Set a debug sync before broadcast message to group on
109 # connection local_server_connection1.
110 [connection server1]
111 SET @debug_save= @@GLOBAL.DEBUG;
112 SET @@GLOBAL.DEBUG='d,group_replication_before_message_broadcast';
113
114 #####################################################################
115 # 2. Commit local_transaction that will be blocked before broadcast.
116 BEGIN;
117 INSERT INTO t1 (c1, c2) VALUES (2, 10);
118 COMMIT;
119
120 ############################################################
121 # 3. Wait until local transaction reaches the
122 # group_replication_before_message_broadcast debug sync point.
123 [connection server_1]
124
125 ############################################################
126 # 4. Execute a transaction on remote server, that will reach first
127 # certification, since transaction on the local server
128 # is blocked before broadcast.
129 [connection server2]
130 BEGIN;
131 INSERT INTO t1 (c1, c2) VALUES (3, 20);
132 COMMIT;
133
134 ############################################################
135 # 5. Signal the waiting thread on local server to resume the
136 # transaction.
137 [connection server_1]
138 SET DEBUG_SYNC='now SIGNAL waiting';
139 SET @@GLOBAL.DEBUG= @debug_save;
140
141 ############################################################
142 # 6. Wait for remote transaction to be executed succesfully
143 on local server.
144 [connection server2]
145 include/sync_slave_sql_with_master.inc
146 ############################################################
147 # 7. If the test case is conflict scenario, local transaction
148 # will end up in an error stating that it was aborted,
149 # since transactions are conflicting and transaction on
150 # remote server was ordered first. If the test case is
151 # is positive scenario, no error will be seen here.
152 [connection server1]
153 [connection server1]
154 SET @@GLOBAL.DEBUG=@debug_save;
155 ############################################################
156 # 8. Sync everything
157 include/rpl_sync.inc
158 ############################################################
159 # 9. Assert that number of certified transactions are the
160 # expected ones.
161 include/assert.inc [The value of Count_Transactions_Checked should be 5 after starting group replication]
162 include/assert.inc [The value of Count_Conflicts_Detected should be 1 after starting group replication]
163 ############################################################
164 # 10. Assert that GTID is increased as expected
165 include/gtid_step_assert.inc [count=2, only_count=1]
166 [connection server1]
167 SET SESSION sql_log_bin= 0;
168 include/gtid_utils_end.inc
169 SET SESSION sql_log_bin= 1;
170 ############################################################
171 # 11. Cleanup (restore the connection back to original)
172 [connection server1]
173
174 # 4. Assert servers consistency.
175
176 [connection server1]
177 include/assert.inc [Table t1 will contain row after the above execution]
178 include/assert.inc [Table t1 will contain row after the above execution]
179 include/assert.inc [Table t1 will contain row after the above execution]
180 include/assert.inc [Table t1 will contain 3 rows after the above execution]
181
182 # 5. Clean up.
183
184 DROP TABLE t1;
185 include/group_replication_end.inc