Debian Codegraph @

mysql-test/suite/x/t/client_accepting.test

raw
1 ## Test for Bug#31742798
2 #
3 # The goal of this test is to synchronize threat that handles
4 # new X Client and thread that handles GR notifications to
5 # occure in the same moment.
6
7 ## Preamble
8 --source include/have_debug.inc
9 --source include/xplugin_preamble.inc
10 --source include/xplugin_create_user.inc
11
12 ## Test data
13
14 ## Test starts here
15 --write_file $MYSQL_TMP_DIR/client_accepting.xpl
16 import debug_point.macro;
17 import connection.macro;
18
19 -->echo
20 -->echo
21 -->echo ## I. Scenario that triggers issue described under: Bug#31742798
22 -->echo #
23 -->echo # 1. Simulate Group-Replication notification (D1), and hang it
24 -->echo # before processing clients
25 -->echo # 2. Make a new X Connection (X2), and hang in after accepting.
26 -->echo # This prevents the session from being created. Synchronization
27 -->echo # points are going to execute thread in order causin crash
28 -->echo # 3. Unblock X2, and validate that its possible to authenticate.
29
30 -->echo
31 -->echo #
32 -->echo # I.1
33 # This DEBUG point is going to hang next X Connection and notice-dispatch
34 callmacro Add_debug_point GLOBAL xsync_gr_notice_bug;
35 DO emit_member_role_change("VIEW-ID");
36
37
38 -->echo
39 -->echo #
40 -->echo # I.2
41 # Make a new session X2 that is going to execute in sync with D1
42 newsession X2 -;
43
44 -->echo
45 -->echo #
46 -->echo # I.3
47 # Go back to default session (this one is not blocked)
48 setsession;
49 # Unblock X Connection (X2)
50 callmacro Remove_debug_point GLOBAL xsync_gr_notice_bug;
51
52 # Validate that X2 is working normally
53 setsession X2;
54 callmacro Verify_its_xprotocol_connection;
55 login x_root ;
56 EOF
57
58 # Install component that provides UDF functions that can be
59 # used to simulate GroupReplication notices.
60 INSTALL COMPONENT "file://component_mysqlx_global_reset";
61
62 # Execute the test
63 exec $MYSQLXTEST
64 -ux_root --password=''
65 --file=$MYSQL_TMP_DIR/client_accepting.xpl 2>&1;
66 UNINSTALL COMPONENT "file://component_mysqlx_global_reset";
67
68
69
70
71 ## Cleanup
72 --source ../include/xplugin_cleanup.inc