Debian Codegraph @

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