Debian Codegraph @

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