Debian Codegraph @

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