From 8c422bf48d7f9c043a6a1e9dc32d6af520cd0631 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 14 Nov 2017 07:22:25 +0800 Subject: [PATCH] MDEV-14256 MariaDB 10.2.10 can't SST with xtrabackup-v2 another followup for 4c2c057d404. there are six possible cases: --port can be set or not. --address can be set, not set, or set but without a port number The correct behavior is: 1 both --port and --address have a port number - use it if it's the same, otherwise an error 2 only --port has the number (--address isn't set) - use the value from --port 3 only --port has the number (--address is set, but has no port) - use the value from --port 4 --port is unset, --address has the port number - use the value from --address 5 --port is unset, --address has no port number - use the value from --address, that is, port is empty string 6 --port is unset, --address is unset - port is unset (an error somewhere later) case 5 wasn't handled correctly --- scripts/wsrep_sst_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh index 5f3739e0aba..3cd2d0e2053 100644 --- a/scripts/wsrep_sst_common.sh +++ b/scripts/wsrep_sst_common.sh @@ -124,9 +124,9 @@ readonly WSREP_SST_OPT_BYPASS readonly WSREP_SST_OPT_BINLOG readonly WSREP_SST_OPT_CONF_SUFFIX -if [ -n "${WSREP_SST_OPT_ADDR_PORT:-}" ]; then +if [ -n "${WSREP_SST_OPT_ADDR:-}" ]; then if [ -n "${WSREP_SST_OPT_PORT:-}" ]; then - if [ "$WSREP_SST_OPT_PORT" != "$WSREP_SST_OPT_ADDR_PORT" ]; then + if [ -n "$WSREP_SST_OPT_ADDR_PORT" -a "$WSREP_SST_OPT_PORT" != "$WSREP_SST_OPT_ADDR_PORT" ]; then wsrep_log_error "port in --port=$WSREP_SST_OPT_PORT differs from port in --address=$WSREP_SST_OPT_ADDR" exit 2 fi