Debian Codegraph @

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

raw
1 include/group_replication.inc [rpl_server_count=3]
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 SET SESSION sql_log_bin= 0;
7 include/gtid_utils.inc
8 SET SESSION sql_log_bin= 1;
9 SET SESSION sql_log_bin= 0;
10 include/gtid_utils.inc
11 SET SESSION sql_log_bin= 1;
12 SET SESSION sql_log_bin= 0;
13 include/gtid_utils.inc
14 SET SESSION sql_log_bin= 1;
15
16 ############################################################
17 # 1. Setup Group Replication on server 1 and 2.
18 include/start_and_bootstrap_group_replication.inc
19 include/start_group_replication.inc
20 include/rpl_gr_wait_for_number_of_members.inc
21
22 ############################################################
23 # 2. Setup a asynchronous replication connection from server 3
24 # into group (server 1)
25 CHANGE REPLICATION SOURCE TO SOURCE_HOST="127.0.0.1", SOURCE_USER="root", SOURCE_PASSWORD="", SOURCE_PORT=SERVER_3_PORT, SOURCE_AUTO_POSITION=1 FOR CHANNEL "";
26 Warnings:
27 Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
28 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.
29 include/start_slave.inc
30
31 ############################################################
32 # 3. Execute some transactions on server 3.
33 SET GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1';
34 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
35 SET GTID_NEXT= 'AUTOMATIC';
36 SET GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2';
37 INSERT INTO t1 VALUES (0);
38 SET GTID_NEXT= 'AUTOMATIC';
39
40 ############################################################
41 # 4. Wait until transactions executed on server 3 are
42 # applied on group.
43 include/sync_slave_sql_with_master.inc
44 include/sync_slave_sql_with_master.inc
45
46 ############################################################
47 # 5. Commit a transaction (T1) on server 3 that won't
48 # replicate to group due to conflicts with T1.
49 # Before that make server 1 block before message
50 # broadcast to group.
51 include/stop_slave.inc
52 SET @server1_debug_save= @@GLOBAL.DEBUG;
53 SET @@GLOBAL.DEBUG= '+d,debug.wait_after_set_snapshot_version_on_transaction_context_log_event';
54 include/start_slave.inc
55 SET GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:3';
56 UPDATE t1 SET c1=3 WHERE c1=0;
57 SET GTID_NEXT= 'AUTOMATIC';
58
59 ############################################################
60 # 6. Wait until server 1 SQL thread from server 3 reaches
61 # the debug sync point:
62 # wait_after_set_snapshot_version_on_transaction_context_log_event
63 [connection server1]
64
65 ############################################################
66 # 7. Commit a transaction (T2) on group on server 2.
67 UPDATE t1 SET c1=2 WHERE c1=0;
68
69 ############################################################
70 # 8. Resume message broadcast to group on server 1.
71 # Check that conflict was detected on asynchronous
72 # replication connection.
73 SET @@GLOBAL.DEBUG= @debug_saved;
74 SET DEBUG_SYNC= 'now SIGNAL signal.resume_after_set_snapshot_version_on_transaction_context_log_event';
75 include/sync_slave_sql_with_master.inc
76 include/wait_for_slave_sql_error.inc [errno=3101]
77 SET DEBUG_SYNC= 'RESET';
78 SET SESSION sql_log_bin= 0;
79 call mtr.add_suppression("Replica SQL for channel '': Error in Xid_log_event: Commit could not be completed, 'Plugin instructed the server to rollback the current transaction.', Error_code:.*");
80 call mtr.add_suppression("Replica: Plugin instructed the server to rollback the current transaction. Error_code:.*");
81 call mtr.add_suppression("Replica SQL for channel '': Worker.* failed executing transaction");
82 call mtr.add_suppression(".*The replica coordinator and worker threads are stopped.*");
83 SET SESSION sql_log_bin= 1;
84
85 ############################################################
86 # 9. Force conflicting transaction on group, by committing
87 # a empty transaction with the same GTID. No data merge
88 # is done.
89 # Commit a new transaction on server 3 to assert that
90 # asynchronous replication is working properly.
91 SET GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:3';
92 BEGIN;
93 COMMIT;
94 SET GTID_NEXT= 'AUTOMATIC';
95 include/rpl_sync.inc
96 include/start_slave_sql.inc
97 SET GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:4';
98 INSERT INTO t1 VALUES (4);
99 SET GTID_NEXT= 'AUTOMATIC';
100
101 ############################################################
102 # 10. Wait until transactions executed on server 3 are
103 # applied on group.
104 include/sync_slave_sql_with_master.inc
105 include/sync_slave_sql_with_master.inc
106
107 ############################################################
108 # 11. Validate data on server 3.
109 include/assert.inc [GTID_EXECUTED must contain all committed GTIDs]
110 include/assert.inc ['There is no value 0 in table t1']
111 include/assert.inc ['There is no value 2 in table t1']
112 include/assert.inc ['There is a value 3 in table t1']
113 include/assert.inc ['There is a value 4 in table t1']
114
115 ############################################################
116 # 12. GTID_EXECUTED on server 1 must contain GTID_EXECUTED
117 # from server 3.
118 # Validate data on server 1.
119 include/assert.inc [GTID_EXECUTED must contain server 3 GTID_EXECUTED]
120 include/assert.inc ['There is no value 0 in table t1']
121 include/assert.inc ['There is a value 2 in table t1']
122 include/assert.inc ['There is no value 3 in table t1']
123 include/assert.inc ['There is a value 4 in table t1']
124
125 ############################################################
126 # 13. GTID_EXECUTED on server 2 must contain GTID_EXECUTED
127 # from server 3.
128 # Validate data on server 2.
129 include/assert.inc [GTID_EXECUTED must contain server 3 GTID_EXECUTED]
130 include/assert.inc ['There is no value 0 in table t1']
131 include/assert.inc ['There is a value 2 in table t1']
132 include/assert.inc ['There is no value 3 in table t1']
133 include/assert.inc ['There is a value 4 in table t1']
134
135 ############################################################
136 # 14. Clean data.
137 DROP TABLE t1;
138 include/sync_slave_sql_with_master.inc
139 include/sync_slave_sql_with_master.inc
140
141 ############################################################
142 # 15. Stop asynchronous replication connection from server 3
143 # into group (server 1)
144 include/stop_slave.inc
145 CHANGE REPLICATION SOURCE TO SOURCE_AUTO_POSITION=0 FOR CHANNEL "";
146
147 ############################################################
148 # 16. Stop Group Replication on server 1 and 2.
149 include/stop_group_replication.inc
150 include/stop_group_replication.inc
151
152 ############################################################
153 # 17. Uninstall GTID utils.
154 SET SESSION sql_log_bin= 0;
155 include/gtid_utils_end.inc
156 SET SESSION sql_log_bin= 1;
157 SET SESSION sql_log_bin= 0;
158 include/gtid_utils_end.inc
159 SET SESSION sql_log_bin= 1;
160 SET SESSION sql_log_bin= 0;
161 include/gtid_utils_end.inc
162 SET SESSION sql_log_bin= 1;
163 include/group_replication_end.inc