Debian Codegraph @

mysql-test/suite/group_replication/r/gr_primary_mode_group_operations_05.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 include/start_and_bootstrap_group_replication.inc
7 include/gr_assert_primary_member.inc
8
9 # 1. Create table to test the transaction conflict
10 CREATE TABLE t1(a int primary key);
11 [connection server2]
12 include/start_group_replication.inc
13
14 # 2. Execute action to switch to multi primary mode
15 SELECT group_replication_switch_to_multi_primary_mode();
16 group_replication_switch_to_multi_primary_mode()
17 Mode switched to multi-primary successfully.
18
19 # 3. Assert on server2 that super_read_only is disabled and
20 # group_replication_enforce_update_everywhere_checks is enabled
21 include/gr_assert_multi_primary_mode.inc
22
23 # 4. Assert on server1 that super_read_only is disabled and
24 # group_replication_enforce_update_everywhere_checks is enabled
25 [connection server1]
26 include/gr_assert_multi_primary_mode.inc
27
28 # 5. Execute two transactions in parallel and confirm that will trigger
29 # a conflict
30
31 ############################################################
32 # 0. Initial setup and checks.
33 [connection server1]
34 SET SESSION sql_log_bin= 0;
35 include/gtid_utils.inc
36 SET SESSION sql_log_bin= 1;
37 include/gtid_step_reset.inc
38
39 ############################################################
40 # 1. Set a debug sync before broadcast message to group on
41 # connection local_server_connection1.
42 [connection server1]
43 SET @debug_save= @@GLOBAL.DEBUG;
44 SET @@GLOBAL.DEBUG='d,group_replication_before_message_broadcast';
45
46 #####################################################################
47 # 2. Commit local_transaction that will be blocked before broadcast.
48 BEGIN;
49 INSERT INTO t1 VALUES(3);
50 COMMIT;
51
52 ############################################################
53 # 3. Wait until local transaction reaches the
54 # group_replication_before_message_broadcast debug sync point.
55 [connection server_1]
56
57 ############################################################
58 # 4. Execute a transaction on remote server, that will reach first
59 # certification, since transaction on the local server
60 # is blocked before broadcast.
61 [connection server2]
62 BEGIN;
63 INSERT INTO t1 VALUES (3);
64 COMMIT;
65
66 ############################################################
67 # 5. Signal the waiting thread on local server to resume the
68 # transaction.
69 [connection server_1]
70 SET DEBUG_SYNC='now SIGNAL waiting';
71 SET @@GLOBAL.DEBUG= @debug_save;
72
73 ############################################################
74 # 6. Wait for remote transaction to be executed succesfully
75 on local server.
76 [connection server2]
77 include/sync_slave_sql_with_master.inc
78 ############################################################
79 # 7. If the test case is conflict scenario, local transaction
80 # will end up in an error stating that it was aborted,
81 # since transactions are conflicting and transaction on
82 # remote server was ordered first. If the test case is
83 # is positive scenario, no error will be seen here.
84 [connection server1]
85 ERROR 40000: Plugin instructed the server to rollback the current transaction.
86 [connection server1]
87 SET @@GLOBAL.DEBUG=@debug_save;
88 ############################################################
89 # 8. Sync everything
90 include/rpl_sync.inc
91 ############################################################
92 # 9. Assert that number of certified transactions are the
93 # expected ones.
94 include/assert.inc [The value of Count_Transactions_Checked should be 3 after starting group replication]
95 include/assert.inc [The value of Count_Conflicts_Detected should be 1 after starting group replication]
96 ############################################################
97 # 10. Assert that GTID is increased as expected
98 include/gtid_step_assert.inc [count=1, only_count=1]
99 [connection server1]
100 SET SESSION sql_log_bin= 0;
101 include/gtid_utils_end.inc
102 SET SESSION sql_log_bin= 1;
103 ############################################################
104 # 11. Cleanup (restore the connection back to original)
105 [connection server1]
106
107 # 6. Cleanup
108 DROP TABLE t1;
109 include/group_replication_end.inc