Debian Codegraph @

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

raw
1 ################################################################################
2 # This test validates that even when there are concurrent select on
3 # performance_schema.replication_group_communication_information table, server
4 # should work fine and remain online state.
5 #
6 # Test:
7 # 00. The test requires three servers: M1, M2 and M3.
8 # 01. On M1, connection thread(T1) executes a select query on
9 # performance_schema.replication_group_communication_information table, then
10 # wait on sync point.
11 # 02. Verify that T1 is waiting on sync point.
12 # 03. Remove the debug flag and execute the select query from another
13 # connection.
14 # 04. Signal to continue T1 and verify that select result is expected and all
15 # members are online.
16 # 05. Cleaning up.
17 ################################################################################
18
19 --source include/have_debug_sync.inc
20 --source include/big_test.inc
21 --source include/have_group_replication_plugin.inc
22 --let $rpl_server_count= 3
23 --source include/group_replication.inc
24
25 --echo
26 --echo #########################################################################
27 --echo # 01. On M1, connection thread(T1) executes the select query on
28 --echo # performance_schema.replication_group_communication_information
29 --echo # itable, then wait on sync point.
30 --let $rpl_connection_name= server1
31 --source include/rpl_connection.inc
32 --let $_group_replication_leaders= query_get_value(SELECT write_consensus_leaders_preferred FROM performance_schema.replication_group_communication_information, write_consensus_leaders_preferred, 1)
33
34 --let $debug_point=group_replication_wait_before_group_communication_information_read_column_value
35 --source include/add_debug_point.inc
36
37 --send SELECT write_consensus_leaders_preferred FROM performance_schema.replication_group_communication_information
38
39 --echo
40 --echo #########################################################################
41 --echo # 02. Verify that T1 is waiting on sync point.
42 --connect (server_1_2,127.0.0.1,root,,test,$MASTER_MYPORT,,)
43
44 --let $rpl_connection_name= server_1_2
45 --source include/rpl_connection.inc
46 --let $wait_condition=SELECT COUNT(*)=1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE State = 'debug sync point: now' and info = "SELECT write_consensus_leaders_preferred FROM performance_schema.replication_group_communication_information"
47 --source include/wait_condition.inc
48
49 --echo
50 --echo #########################################################################
51 --echo # 03. Remove the debug flag and execute the select query from another
52 --echo # connection.
53 --let $debug_point=group_replication_wait_before_group_communication_information_read_column_value
54 --source include/remove_debug_point.inc
55
56 --replace_result $_group_replication_leaders LEADERS
57 SELECT write_consensus_leaders_preferred FROM performance_schema.replication_group_communication_information;
58
59 --echo
60 --echo ########################################################################
61 --echo # 04. Signal to continue T1 and verify that select result is expected
62 --echo # and all members are online.
63 SET DEBUG_SYNC= 'now SIGNAL signal.after_group_communication_information_read_column_value_continue';
64
65 --let $rpl_connection_name= server1
66 --source include/rpl_connection.inc
67 --replace_result $_group_replication_leaders LEADERS
68 --reap
69
70 let $wait_condition=SELECT count(*)=1 FROM performance_schema.replication_group_communication_information WHERE write_consensus_leaders_preferred IS NOT null AND write_consensus_leaders_actual IS NOT null;
71 --source include/wait_condition.inc
72
73 let $wait_condition=SELECT COUNT(*)=3 FROM performance_schema.replication_group_members WHERE member_state="ONLINE";
74 --source include/wait_condition.inc
75
76 --echo
77 --echo ################################################################
78 --echo # 05. Cleanup
79 --source include/group_replication_end.inc