Debian Codegraph @

mysql-test/suite/group_replication/r/gr_multi_primary_unique_key_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 ############################################################
8 # 1. Create a table on server1.
9 [connection server1]
10 CREATE TABLE t1 (a INT, d INT, b INT UNIQUE KEY, c INT UNIQUE KEY, PRIMARY KEY(a, d));
11 INSERT INTO t1 VALUE(1, 2, 3, 4);
12 include/rpl_sync.inc
13
14 ############################################################
15 # 2. Set a debug sync before broadcast message to group on
16 # connection server_1.
17 # Commit a transaction that will be block before broadcast.
18 [connection server_1]
19 SET @debug_save= @@GLOBAL.DEBUG;
20 SET @@GLOBAL.DEBUG='d,group_replication_before_message_broadcast';
21 BEGIN;
22 UPDATE t1 SET a=5 AND d=6 WHERE c=4;
23 COMMIT;
24
25 ############################################################
26 # 3. Wait until server_1 connection reaches the
27 # group_replication_before_message_broadcast debug sync point.
28 [connection server1]
29
30 ############################################################
31 # 4. Execute a transaction on server2, that will reach first
32 # certification, since server_1 is blocked before broadcast.
33 [connection server2]
34 UPDATE t1 SET b=6 WHERE c=4;
35
36 ############################################################
37 # 5. Signal the waiting thread on server_1 to resume.
38 [connection server1]
39 SET DEBUG_SYNC='now SIGNAL waiting';
40 SET @@GLOBAL.DEBUG= @debug_save;
41
42 ############################################################
43 # 6. It will end up in an error stating that it was aborted,
44 # since transactions are conflicting and server2 was
45 # ordered first.
46 [connection server2]
47 include/sync_slave_sql_with_master.inc
48 [connection server_1]
49 ERROR 40000: Plugin instructed the server to rollback the current transaction.
50
51 ############################################################
52 # 7. Assert that number of certified transactions are the
53 # expected ones.
54 [connection server1]
55 include/assert.inc [The value of Count_Transactions_Checked should be 4 after starting group replication]
56 include/assert.inc [The value of Count_Conflicts_Detected should be 1 after starting group replication]
57
58 ############################################################
59 # Checking the positive case in which there is no conflict.
60 ############################################################
61
62 ############################################################
63 # 2. Set a debug sync before broadcast message to group on
64 # connection server_1.
65 # Commit a transaction that will be block before broadcast.
66 [connection server_1]
67 SET @@GLOBAL.DEBUG='d,group_replication_before_message_broadcast';
68 BEGIN;
69 INSERT INTO t1 VALUE(10, 11, 12, 13);
70 COMMIT;
71
72 ############################################################
73 # 3. Wait until server_1 connection reaches the
74 # group_replication_before_message_broadcast debug sync point.
75 [connection server1]
76
77 ############################################################
78 # 4. Execute a transaction on server2, that will reach first
79 # certification, since server_1 is blocked before broadcast.
80 [connection server2]
81 INSERT INTO t1 VALUE(14, 15, 16, 17);
82 include/sync_slave_sql_with_master.inc
83
84 ############################################################
85 # 5. Signal the waiting thread on server_1 to resume.
86 [connection server1]
87 SET DEBUG_SYNC='now SIGNAL waiting';
88 SET @@GLOBAL.DEBUG= @debug_save;
89
90 ########################################################################
91 # 5. It will execute without error as the conflicting transactions have
92 # been removed.
93 [connection server_1]
94 include/rpl_sync.inc
95
96 ############################################################
97 # 6. Assert that number of certified transactions are the
98 # expected ones.
99 [connection server1]
100 include/assert.inc [Table t1 will contain row after the above execution]
101 include/assert.inc [Table t1 will contain row after the above execution]
102 include/assert.inc [Table t1 will contain row after the above execution]
103 include/assert.inc [Table t1 will contain 3 rows after the above execution]
104 include/assert.inc [The value of Count_Transactions_Checked should be 6 after starting group replication]
105 include/assert.inc [The value of Count_Conflicts_Detected should be 1 after starting group replication]
106
107 ############################################################
108 # Clean up.
109 DROP TABLE t1;
110 include/group_replication_end.inc