Debian Codegraph @

mysql-test/suite/rpl_gtid/t/rpl_async_conn_failover_checks.test

raw
1 # ==== Purpose ====
2 #
3 # This test verifies below checks:
4 #
5 # I. It verifies that disabling AUTO_POSITION while enabling Asynchronous
6 # Replication Connection Failover results in error and does not change
7 # their existing values.
8 #
9 # II. It also verifies that replica thread does not start when Asynchronous
10 # Replication Connection Failover is enabled and GTID_MODE = OFF_PERMISSIVE
11 # is provided as startup option on server start, and even after server start
12 # starting replica won't be allowed for the same options.
13 #
14 # ==== Implementation ====
15 #
16 # 1. Enable AUTO_POSITION.
17 # 2. Verify disabling AUTO_POSITION while enabling Asynchronous
18 # Replication Connection Failover results in
19 # ER_DISABLE_AUTO_POSITION_REQUIRES_ASYNC_RECONNECT_OFF error.
20 # 3. Verify Asynchronous Replication Connection Failover is disabled and
21 # Auto_position is enabled.
22 # 4. Verify restart server with Asynchronous Replication Connection
23 # Failover enabled and GTID_MODE = OFF_PERMISSIVE will stop replica
24 # thread from start with ER_RPL_ASYNC_RECONNECT_GTID_MODE_OFF_CHANNEL
25 # error logged in error log.
26 # 5. Verify start replica after restart server also does not start replica
27 # threads and fails with with ER_RPL_ASYNC_RECONNECT_GTID_MODE_OFF
28 # error.
29 # 6. Clean up.
30 #
31
32 --let $use_gtids= 1
33 --let $rpl_skip_start_slave= 1
34 --source include/not_rpl_gtid_only.inc
35 --source include/master-slave.inc
36
37 --source include/rpl_connection_slave.inc
38 call mtr.add_suppression("Detected misconfiguration: replication channel '' was configured with SOURCE_CONNECTION_AUTO_FAILOVER = 1.*");
39
40 --echo #
41 --echo # 1. Enable AUTO_POSITION.
42 --echo #
43
44 CHANGE REPLICATION SOURCE TO SOURCE_AUTO_POSITION=1;
45
46
47 --echo #
48 --echo # 2. Verify disabling AUTO_POSITION while enabling Asynchronous
49 --echo # Replication Connection Failover results in
50 --echo # ER_RPL_ASYNC_RECONNECT_AUTO_POSITION_OFF
51 --echo #
52
53 --error ER_RPL_ASYNC_RECONNECT_AUTO_POSITION_OFF
54 CHANGE REPLICATION SOURCE TO SOURCE_AUTO_POSITION=0, SOURCE_CONNECTION_AUTO_FAILOVER=1;
55
56 --echo #
57 --echo # 3. Verify Asynchronous Replication Connection Failover is disabled and
58 --echo # Auto_position is enabled.
59 --echo #
60
61 --let $assert_text= 'Asynchronous Replication Connection Failover is disabled'
62 --let $assert_cond= [SELECT SOURCE_CONNECTION_AUTO_FAILOVER FROM performance_schema.replication_connection_configuration, SOURCE_CONNECTION_AUTO_FAILOVER, 1] = 0
63 --source include/assert.inc
64
65 --let $assert_text= 'Auto_position is enabled'
66 --let $assert_cond= [SELECT AUTO_POSITION FROM performance_schema.replication_connection_configuration, AUTO_POSITION, 1] = 1
67 --source include/assert.inc
68
69
70 --echo #
71 --echo # 4. Verify restart server with Asynchronous Replication Connection
72 --echo # Failover enabled and GTID_MODE = OFF_PERMISSIVE will stop replica
73 --echo # thread from start with ER_RPL_ASYNC_RECONNECT_GTID_MODE_OFF_CHANNEL
74 --echo # error logged in error log.
75 --echo #
76
77 CHANGE REPLICATION SOURCE TO SOURCE_CONNECTION_AUTO_FAILOVER=1;
78
79 --let $rpl_server_number = 2
80 --let $rpl_skip_start_slave=
81 --let $rpl_server_parameters = --gtid-mode=off_permissive
82 --source include/rpl_restart_server.inc
83
84 --let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.2.err
85 --let $assert_count = 1
86 --let $assert_select = Detected misconfiguration: replication channel '' was configured with SOURCE_CONNECTION_AUTO_FAILOVER = 1, but the server was started with a value other then --gtid-mode = ON. Either reconfigure replication using CHANGE REPLICATION SOURCE TO SOURCE_CONNECTION_AUTO_FAILOVER = 0 FOR CHANNEL '', or change GTID_MODE to value ON, before starting the replica receiver thread.
87 --let $assert_text = Replication channel '' could not be started as GTID_MODE was not ON.
88 --source include/assert_grep.inc
89
90
91 --let $rpl_channel_name= ''
92 --let $slave_param= Slave_IO_Running
93 --let $slave_param_value= No
94 --source include/check_slave_param.inc
95
96
97 --echo #
98 --echo # 5. Verify start replica after restart server also does not start
99 --echo # replica threads and fails with with
100 --echo # ER_RPL_ASYNC_RECONNECT_GTID_MODE_OFF error.
101 --echo #
102
103 --error ER_RPL_ASYNC_RECONNECT_GTID_MODE_OFF
104 START SLAVE;
105
106
107 --echo #
108 --echo # 6. Clean up.
109 --echo #
110
111 CHANGE REPLICATION SOURCE TO SOURCE_CONNECTION_AUTO_FAILOVER = 0;
112 SET @@global.gtid_mode = ON_PERMISSIVE;
113 SET @@global.gtid_mode = ON;
114
115 --let $rpl_only_running_threads= 1
116 --source include/rpl_end.inc