galera SST scripts: moving mysqldump-specific code out of the wsrep_sst_common

This commit is contained in:
Julius Goryavsky 2024-09-15 04:34:33 +02:00
parent 228cb073ad
commit 64356509af
2 changed files with 16 additions and 14 deletions

View file

@ -865,19 +865,6 @@ readonly WSREP_SST_OPT_ADDR_PORT
script_binary=$(dirname "$0")
SCRIPTS_DIR=$(cd "$script_binary"; pwd)
EXTRA_DIR="$SCRIPTS_DIR/../extra"
CLIENT_DIR="$SCRIPTS_DIR/../client"
if [ -x "$CLIENT_DIR/mysql" ]; then
MYSQL_CLIENT="$CLIENT_DIR/mysql"
else
MYSQL_CLIENT=$(commandex 'mysql')
fi
if [ -x "$CLIENT_DIR/mysqldump" ]; then
MYSQLDUMP="$CLIENT_DIR/mysqldump"
else
MYSQLDUMP=$(commandex 'mysqldump')
fi
if [ -x "$SCRIPTS_DIR/my_print_defaults" ]; then
MY_PRINT_DEFAULTS="$SCRIPTS_DIR/my_print_defaults"

View file

@ -23,6 +23,20 @@ set -ue
. $(dirname "$0")/wsrep_sst_common
CLIENT_DIR="$SCRIPTS_DIR/../client"
if [ -x "$CLIENT_DIR/mysql" ]; then
MYSQL_CLIENT="$CLIENT_DIR/mysql"
else
MYSQL_CLIENT=$(commandex 'mysql')
fi
if [ -x "$CLIENT_DIR/mysqldump" ]; then
MYSQLDUMP="$CLIENT_DIR/mysqldump"
else
MYSQLDUMP=$(commandex 'mysqldump')
fi
wait_previous_sst
EINVAL=22
@ -37,7 +51,8 @@ if is_local_ip "$WSREP_SST_OPT_HOST_UNESCAPED" && \
[ "$WSREP_SST_OPT_PORT" = "$WSREP_SST_OPT_LPORT" ]
then
wsrep_log_error \
"destination address '$WSREP_SST_OPT_HOST:$WSREP_SST_OPT_PORT' matches source address."
"destination address '$WSREP_SST_OPT_HOST:$WSREP_SST_OPT_PORT'" \
"matches source address."
exit $EINVAL
fi