mariadb/mysql-test/include/rpl_reconnect.inc
Anel Husakovic 8d6ae0f2f9 MDEV-32004: Remove extra server_<num>_1 connections during initialization
- Remove extra connections in the form of `server_number_1` for the same server
  during initialization of servers in the `rpl_init.inc` file.
- Remove disconnecting and reconnecting to the same connections,
  since they are not used by the test.
- Update comments about the above.

- Reviewer: <knielsen@knielsen-hq.org>
            <brandon.nesterenko@mariadb.com>
2023-09-14 21:35:40 +02:00

121 lines
2.9 KiB
PHP

# ==== Purpose ====
#
# After a server has restarted, this waits for all clients configured
# by rpl_init.inc and/or master-slave.inc to reconnect again.
#
# For each connection, it issues this:
# --enable_reconnect
# --source include/wait_until_connected_again.inc
# --disable_reconnect
#
#
# ==== Usage ====
#
# --let $rpl_server_number= N
# [--let $rpl_debug= 1]
# --source include/rpl_reconnect.inc
#
# Parameters:
# $rpl_server_number
# Number to identify the server that needs to reconnect. 1 is the
# master server, 2 the slave server, 3 the 3rd server, and so on.
# Cf. include/rpl_init.inc
#
# $rpl_debug
# See include/rpl_init.inc
--let $include_filename= rpl_reconnect.inc
--source include/begin_include_file.inc
if (!$rpl_server_number)
{
--die ERROR IN TEST: you must set $rpl_server_number before you source rpl_connect.inc
}
if ($rpl_debug)
{
--echo ---- Enable reconnect ----
}
--let $_rpl_server_number= $rpl_server_number
--dec $_rpl_server_number
if (!$_rpl_server_number)
{
--let $rpl_connection_name= default
--source include/rpl_connection.inc
--enable_reconnect
--let $rpl_connection_name= master
--source include/rpl_connection.inc
--enable_reconnect
--let $rpl_connection_name= master1
--source include/rpl_connection.inc
--enable_reconnect
}
--dec $_rpl_server_number
if (!$_rpl_server_number)
{
--let $rpl_connection_name= slave
--source include/rpl_connection.inc
--enable_reconnect
--let $rpl_connection_name= slave1
--source include/rpl_connection.inc
--enable_reconnect
}
--let $rpl_connection_name= server_$rpl_server_number
--source include/rpl_connection.inc
--enable_reconnect
if ($rpl_debug)
{
--echo ---- Wait for reconnect and disable reconnect on all connections ----
}
--let $_rpl_server_number= $rpl_server_number
--dec $_rpl_server_number
if (!$_rpl_server_number)
{
--let $rpl_connection_name= default
--source include/rpl_connection.inc
--source include/wait_until_connected_again.inc
--disable_reconnect
--let $rpl_connection_name= master
--source include/rpl_connection.inc
--source include/wait_until_connected_again.inc
--disable_reconnect
--let $rpl_connection_name= master1
--source include/rpl_connection.inc
--source include/wait_until_connected_again.inc
--disable_reconnect
}
--dec $_rpl_server_number
if (!$_rpl_server_number)
{
--let $rpl_connection_name= slave
--source include/rpl_connection.inc
--source include/wait_until_connected_again.inc
--disable_reconnect
--let $rpl_connection_name= slave1
--source include/rpl_connection.inc
--source include/wait_until_connected_again.inc
--disable_reconnect
}
--let $rpl_connection_name= server_$rpl_server_number
--source include/rpl_connection.inc
--source include/wait_until_connected_again.inc
--disable_reconnect
--let $include_filename= rpl_reconnect.inc
--source include/end_include_file.inc