Debian Codegraph @

mysql-test/suite/group_replication/include/gr_recovery_channel_block.inc

raw
1 ################################################################################
2 # Make a member to be blocked on join during distributed recovery.
3 #
4 # Requirements:
5 # 1) A table t1 with a auto-increment must exist.
6 # CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY)
7 # 2) Group must have 2 members, member 2 will be one that will be blocked.
8 #
9 # Include:
10 # 0. The test requires two servers: M1 and M2.
11 # 1. Stop M2.
12 # 2. Commit a transaction on table t1 on M1.
13 # 3. Lock table t1 on M2.
14 # 3. Join M2 to the group, it will be blocked.
15 #
16 # to unblock M2 do:
17 # --source ../include/gr_recovery_channel_resume.inc
18 #
19 ################################################################################
20
21 --let $include_filename= gr_recovery_channel_block.inc
22 --source include/begin_include_file.inc
23
24 --let $_saved_connection= $CURRENT_CONNECTION
25 --disable_query_log
26
27 --let $rpl_connection_name= server2
28 --source include/rpl_connection.inc
29 --source include/rpl_sync.inc
30 --source include/stop_group_replication.inc
31
32 --let $rpl_connection_name= server1
33 --source include/rpl_connection.inc
34 INSERT INTO t1 VALUES (NULL);
35
36 --let $rpl_connection_name= server_2
37 --source include/rpl_connection.inc
38 LOCK TABLE t1 READ;
39
40 --let $rpl_connection_name= server2
41 --source include/rpl_connection.inc
42 --let $group_replication_start_member_state= RECOVERING
43 --source include/start_group_replication.inc
44
45 --let $wait_condition= SELECT COUNT(*)=1 FROM performance_schema.replication_connection_status where CHANNEL_NAME="group_replication_recovery" and SERVICE_STATE="ON"
46 --source include/wait_condition.inc
47
48 --enable_query_log
49 --connection $_saved_connection
50
51 --let $include_filename= gr_recovery_channel_block.inc
52 --source include/end_include_file.inc