Debian Codegraph @

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

raw
1 ###############################################################################
2 # Bug#27294009 - XCOM ENTERS AN INFINITE LOOP IN CASE OF A REQUEST_RETRY
3 #
4 # This test verifies that when the bootstrap node is not correctly set up in a
5 # group, control requests (e.g., join, leave) will fail cleanly. Before fixing
6 # this bug, issuing control requests to a group without the boot node correctly
7 # set up would lead to nodes hanging indefinitely.
8 #
9 # The ideal scenario to test this bug fix would be to simultaneously start a
10 # group with two (or more) nodes without setting any as the boot node. However,
11 # due to the synchronous nature of MTR tests, it is not possible to do so, as
12 # nodes will try (and fail) to connect to each other in succession, never
13 # getting a chance to actually communicate. Hence, it is necessary to trick a
14 # single node into connecting to itself.
15 #
16 # Test:
17 # 0. This test requires one server.
18 # 1. Set up seeds with alternative localhost addresses to force the node to
19 # connect to itself.
20 # 2. Start group replication without setting the boot node flag to true.
21 # 3. The join request fails cleanly without the node hanging.
22 # 4. Clean up.
23 ###############################################################################
24 --source include/have_group_replication_plugin.inc
25 --let $rpl_skip_group_replication_start= 1
26 --source include/group_replication.inc
27 --echo ############################################################
28 --echo # 1. Suppress expected error messages
29 --echo ############################################################
30 SET SESSION sql_log_bin= 0;
31 call mtr.add_suppression("Plugin group_replication reported: 'read failed'");
32 call mtr.add_suppression("Plugin group_replication reported: '\\[GCS\\] read failed'");
33 call mtr.add_suppression("Plugin group_replication reported: 'Timeout on wait for view after joining group'");
34 call mtr.add_suppression("\\[GCS\\] Error connecting to all peers. Member join failed. Local port:*");
35 call mtr.add_suppression("\\[GCS\\] The member was unable to join the group.*");
36 SET SESSION sql_log_bin= 1;
37
38 --echo ############################################################
39 --echo # 2. Define and setup seeds to force self connect
40 --echo ############################################################
41 --let $local_address= `SELECT @@GLOBAL.group_replication_local_address;`
42 --let $xcom_port = `SELECT SUBSTR("$local_address",11,5);`
43 --let $localhost_addr = `SELECT CONCAT("localhost:","$xcom_port");`
44 --let $localhost_alt_addr = `SELECT CONCAT("127.0.0.1:","$xcom_port");`
45
46 --replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME
47 --eval SET @@global.group_replication_group_name="$group_replication_group_name"
48 --replace_result $xcom_port XCOM_PORT
49 --eval SET @@global.group_replication_group_seeds=`localhost:$xcom_port, 127.0.0.1:$xcom_port`
50
51 --echo ############################################################
52 --echo # 3. Start the node and expect it to fail
53 --echo ############################################################
54 --error ER_GROUP_REPLICATION_CONFIGURATION
55 START GROUP_REPLICATION;
56
57 --echo ############################################################
58 --echo # 4. Clean up
59 --echo ############################################################
60 --source include/group_replication_end.inc