Debian Codegraph @

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

raw
1 ################################################################################
2 # Validate Group Replication can be stopped when replication channels are
3 # running and autocommit is disabled.
4 #
5 # Test:
6 # 0. This test requires 2 servers:
7 # server1: group member
8 # server2: single server
9 # 1. Deploy a group on server1.
10 # 2. Configure a channel on server1 that replicates from
11 # server2.
12 # 3. Stop Group Replication on server1 with autocommit disabled.
13 # 4. Assert that no transaction was logged due to
14 # STOP GROUP_REPLICATION;
15 # 5. Clean up.
16 ###############################################################################
17 --source include/have_group_replication_plugin.inc
18 --let $rpl_skip_group_replication_start= 1
19 --source include/group_replication.inc
20
21
22 --echo
23 --echo ############################################################
24 --echo # 1. Deploy a group on server1.
25 --let $rpl_connection_name= server1
26 --source include/rpl_connection.inc
27 --source include/start_and_bootstrap_group_replication.inc
28
29
30 --echo
31 --echo ############################################################
32 --echo # 2. Configure a channel on server1 that replicates from
33 --echo # server2.
34 --let $rpl_connection_name= server1
35 --source include/rpl_connection.inc
36 --replace_result $SERVER_MYPORT_2 SERVER_2_PORT
37 --eval CHANGE REPLICATION SOURCE TO SOURCE_HOST='127.0.0.1', SOURCE_USER='root', SOURCE_PORT=$SERVER_MYPORT_2, SOURCE_AUTO_POSITION=1 FOR CHANNEL 'ch1'
38
39 --let $rpl_channel_name='ch1'
40 --source include/start_slave.inc
41
42
43 --echo
44 --echo ############################################################
45 --echo # 3. Stop Group Replication on server1 with autocommit disabled.
46 --let $rpl_connection_name= server1
47 --source include/rpl_connection.inc
48 SET @saved_autocommit = @@SESSION.autocommit;
49 SET @@SESSION.autocommit = 0;
50
51 STOP GROUP_REPLICATION;
52 COMMIT;
53
54
55 --echo
56 --echo ############################################################
57 --echo # 4. Assert that no transaction was logged due to
58 --echo # STOP GROUP_REPLICATION;
59 --let $rpl_connection_name= server1
60 --source include/rpl_connection.inc
61 --let $group_replication_member_state = OFFLINE
62 --source include/gr_wait_for_member_state.inc
63
64 --let $expected_gtid_set= "$group_replication_group_name:1"
65 --let $assert_text= STOP GROUP_REPLICATION did not generate a GTID
66 --let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = $expected_gtid_set
67 --source include/assert.inc
68
69 --let $vcle_seq= Gtid # Query/BEGIN # View_change # Query/COMMIT
70 # View change (s1 bootstrap)
71 --let $event_sequence= $vcle_seq
72 --source include/assert_binlog_events.inc
73
74
75 --echo
76 --echo ############################################################
77 --echo # 5. Clean up.
78 --let $rpl_connection_name= server1
79 --source include/rpl_connection.inc
80 SET @@SESSION.autocommit = @saved_autocommit;
81
82 --let $rpl_channel_name='ch1'
83 --let $rpl_multi_source= 1
84 --let $rpl_reset_slave_all= 1
85 --source include/rpl_reset_slave.inc
86 --let $rpl_channel_name=
87 --let $rpl_multi_source=
88
89 --source include/group_replication_end.inc