Debian Codegraph @

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

raw
1 ################################################################################
2 # This test validates `running_transactions_timeout` features works only when
3 # all members in the group have version greater then or equal to 8.0.29.
4 #
5 # NOTE: Since lowest member version is primary and they do not have this
6 # feature, this test can only be run from secondary.
7 #
8 # Test:
9 # 0. The test requires two servers: M1(8.0.28) and M2(8.0.29+).
10 # 1. Start group in single primary mode.
11 # Server1 will be primary and server 2 secondary.
12 # 2. Begin change of primary from server2(secondary).
13 # Primary change should fail since server1 version is 8.0.28.
14 # running_transactions_timeout is compatible with version 8.0.28 or greater.
15 # 3. Cleanup.
16 ################################################################################
17
18 --source include/have_debug.inc
19 --source include/have_group_replication_plugin.inc
20 --let $rpl_skip_group_replication_start= 1
21 --let $rpl_group_replication_single_primary_mode=1
22 --source include/group_replication.inc
23
24 --echo
25 --echo # 1. Start group in single primary mode.
26 --echo # Server1 will be primary and server 2 secondary.
27
28 --let $rpl_connection_name= server1
29 --source include/rpl_connection.inc
30
31 --let $server1_uuid= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1)
32 SET @@GLOBAL.DEBUG= '+d,group_replication_version_8_0_28';
33 --source include/start_and_bootstrap_group_replication.inc
34
35 --let $rpl_connection_name= server2
36 --source include/rpl_connection.inc
37
38 --let $server2_uuid= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1)
39 SET SESSION sql_log_bin=0;
40 call mtr.add_suppression("Member version is read compatible with the group.");
41 SET SESSION sql_log_bin=1;
42 --source include/start_group_replication.inc
43
44 --echo
45 --echo # 2. Begin change of primary from server2(secondary).
46 --echo # Primary change should fail since server1 version is 8.0.28.
47 --echo # running_transactions_timeout is compatible with version 8.0.28 or greater.
48
49 --let $rpl_connection_name= server2
50 --source include/rpl_connection.inc
51
52 --replace_result $server2_uuid SERVER2_UUID
53 --error ER_CANT_INITIALIZE_UDF
54 --eval SELECT group_replication_set_as_primary("$server2_uuid", 0)
55
56 --echo
57 --echo # 3. Cleanup.
58
59 --let $rpl_connection_name= server1
60 --source include/rpl_connection.inc
61
62 SET @@GLOBAL.DEBUG= '-d,group_replication_version_8_0_28';
63
64 --source include/group_replication_end.inc