| 1 |
## Test that verifies if X Plugin creates admin-srv-session |
| 2 |
## at initialization. |
| 3 |
# |
| 4 |
|
| 5 |
--source include/have_debug.inc |
| 6 |
--source include/xplugin_preamble.inc |
| 7 |
--source include/xplugin_create_user.inc |
| 8 |
|
| 9 |
# Following error might be visible in error log, because when connection timeouts on |
| 10 |
# client-side then on server queues the connection in acceptance backlog. |
| 11 |
# |
| 12 |
# Thus server processes all connections stored in the backlog |
| 13 |
# after reseting "xplugin_init_wait", which causes the error message. |
| 14 |
# |
| 15 |
CALL mtr.add_suppression("Error initializing session for connection: Too many connections"); |
| 16 |
|
| 17 |
## Test starts here |
| 18 |
|
| 19 |
--echo |
| 20 |
--echo |
| 21 |
--echo ## I. Verify that X Plugin can start when `max_connections` limit |
| 22 |
--echo ## was reached |
| 23 |
--echo # |
| 24 |
--echo # 1. Restart server with `max_connections` set to 1 and block |
| 25 |
--echo # initialization of X Plugin |
| 26 |
--echo # |
| 27 |
--echo # a. Make X Protocol connection, which should fails, |
| 28 |
--echo # that is going to show that X Plugin is not running |
| 29 |
--echo # b. Make two classic protocol connection with root to |
| 30 |
--echo # reach the limit (first connection is `default` |
| 31 |
--echo # which is done be mysqltest at restart) |
| 32 |
--echo # was compressed is replied with error without executing it |
| 33 |
--echo # c. Unblock X Plugin and show that the initialization was |
| 34 |
--echo # successful |
| 35 |
|
| 36 |
--let $xtest_file= $MYSQL_TMP_DIR/admin_ping_mysqlx.xpl |
| 37 |
--write_file $xtest_file |
| 38 |
SELECT "Some expected string" as result; |
| 39 |
EOF |
| 40 |
|
| 41 |
|
| 42 |
--echo |
| 43 |
--echo # |
| 44 |
--echo # I.1 |
| 45 |
|
| 46 |
let $restart_parameters = restart: --debug="+d,xplugin_init_wait" --loose-mysqlx_cache_cleaner=0; |
| 47 |
--let $wait_for_tcpsocket_status=no_wait |
| 48 |
--let $wait_for_unixsocket_status=no_wait |
| 49 |
--source include/restart_mysqld.inc |
| 50 |
|
| 51 |
|
| 52 |
--echo |
| 53 |
--echo # |
| 54 |
--echo # I.1.a |
| 55 |
|
| 56 |
# |
| 57 |
# This wait is not needed, |
| 58 |
# anyway it is better to keep it here for future source-code changes |
| 59 |
sleep 1; |
| 60 |
|
| 61 |
--error 1 |
| 62 |
exec $MYSQLXTEST |
| 63 |
-ux_root --password='' --timeout=20000 |
| 64 |
--file=$xtest_file >/dev/null 2>&1; |
| 65 |
|
| 66 |
--echo |
| 67 |
--echo # |
| 68 |
--echo # I.1.b |
| 69 |
|
| 70 |
# Once connection was already done in "I.1" |
| 71 |
# when restart_mysqld.inc was called |
| 72 |
# We need to do only one connection here |
| 73 |
# |
| 74 |
# Root account is not strictly limited by |
| 75 |
# max_connections thus we were able to do |
| 76 |
# two connections |
| 77 |
connect(g2_conn,localhost,root,,test); |
| 78 |
|
| 79 |
disconnect g2_conn; |
| 80 |
connection default; |
| 81 |
|
| 82 |
--echo |
| 83 |
--echo # |
| 84 |
--echo # I.1.c |
| 85 |
|
| 86 |
--let $debug_point= xplugin_init_wait |
| 87 |
--source include/remove_debug_point.inc |
| 88 |
|
| 89 |
--source ../include/xplugin_wait_for_connection_closure.inc |
| 90 |
|
| 91 |
--let $wait_for_tcpsocket_status=valid_value |
| 92 |
--let $wait_for_unixsocket_status=valid_value |
| 93 |
--source include/xplugin_wait_for_interfaces.inc |
| 94 |
|
| 95 |
--exec $MYSQLXTEST -ux_root --password='' --file=$xtest_file 2>&1 |
| 96 |
|
| 97 |
|
| 98 |
## Cleanup |
| 99 |
--let $restart_parameters = restart: |
| 100 |
--source include/restart_mysqld.inc |
| 101 |
|
| 102 |
--source ../include/xplugin_cleanup.inc |