Debian Codegraph @

mysql-test/suite/group_replication/t/gr_view_change_order.test

raw
1 # This test evaluates that no local transaction can be logged after the view
2 # change event if it was executed before the view change.
3 #
4 # Steps:
5 # 0. Two server with GR stopped
6 # 1. Start group replication on server 1
7 # Execute a transaction and block before logging to the binlog.
8 #
9
10 --source include/big_test.inc
11 --source include/have_debug_sync.inc
12 --source include/have_group_replication_plugin.inc
13 --let $rpl_skip_group_replication_start= 1
14 --source include/group_replication.inc
15
16 --echo #
17 --echo # Start group replication on server 1
18 --echo # Execute a transaction and block before logging to the binlog.
19 --echo #
20
21 --let $rpl_connection_name= server1
22 --source include/rpl_connection.inc
23
24 --source include/start_and_bootstrap_group_replication.inc
25
26 CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
27
28 INSERT INTO t1 VALUES (NULL);
29
30 SET @@GLOBAL.DEBUG='+d,group_replication_after_before_commit_hook';
31
32 --send INSERT INTO t1 VALUES (NULL);
33
34 --let $rpl_connection_name= server_1
35 --source include/rpl_connection.inc
36
37 --sleep 1
38 --let $wait_condition=SELECT COUNT(*)=1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE State = 'debug sync point: now'
39 SET @@GLOBAL.DEBUG='-d,group_replication_after_before_commit_hook';
40 #ensure server 1 does not fails while waiting
41 SET @@GLOBAL.DEBUG='+d,sql_int_wait_for_gtid_executed_no_timeout';
42
43 --echo #
44 --echo # Start group replication on server 2
45 --echo # The server should block waiting for recovery
46 --echo #
47
48 --let $rpl_connection_name= server2
49 --source include/rpl_connection.inc
50
51 --let $group_replication_start_member_state= RECOVERING
52 --source include/start_group_replication.inc
53
54 --sleep 5
55
56 --let $server2_uuid= `SELECT @@GLOBAL.SERVER_UUID`
57 --let $member_state= query_get_value(SELECT Member_State from performance_schema.replication_group_members WHERE member_id= '$server2_uuid', Member_State, 1)
58 --let $assert_text= The member should still be recovering
59 --let $assert_cond= "$member_state" = "RECOVERING"
60 --source include/assert.inc
61
62 --echo #
63 --echo # Unblock local query wait on server 1
64 --echo # Recovery should unblock on server 2
65 --echo #
66
67 --let $rpl_connection_name= server_1
68 --source include/rpl_connection.inc
69
70 SET DEBUG_SYNC= "now SIGNAL signal.group_replication_after_before_commit_hook_continue";
71 SET @@GLOBAL.DEBUG='-d,sql_int_wait_for_gtid_executed_no_timeout';
72
73 --let $rpl_connection_name= server2
74 --source include/rpl_connection.inc
75
76 --let $group_replication_member_state= ONLINE
77 --source include/gr_wait_for_member_state.inc
78
79 --echo #
80 --echo # Add some more queries
81 --echo # Restart server 2 and check all is fine.
82 --echo #
83
84 --let $rpl_connection_name= server1
85 --source include/rpl_connection.inc
86
87 --reap
88
89 INSERT INTO t1 VALUES (NULL);
90 INSERT INTO t1 VALUES (NULL);
91
92 --let $rpl_connection_name= server2
93 --source include/rpl_connection.inc
94
95 --source include/stop_group_replication.inc
96 --source include/start_group_replication.inc
97
98 --let $assert_text= Table t1 will contain 3 rows
99 --let $assert_cond= "[SELECT COUNT(*) AS count FROM t1, count, 1]" = "4"
100 --source include/assert.inc
101
102 --let $rpl_connection_name= server1
103 --source include/rpl_connection.inc
104
105 --let $assert_text= Table t1 will contain 3 rows
106 --let $assert_cond= "[SELECT COUNT(*) AS count FROM t1, count, 1]" = "4"
107 --source include/assert.inc
108
109 DROP TABLE t1;
110
111 --source include/group_replication_end.inc