Skip to content

Commit d48ac8b

Browse files
committed
MDEV-17848: Galera test failure on galera_sst_xtrabackup-v2[_data_dir]
The mariabackup SST script was incorrectly processes innodb_data_home_dir parameter if it is specified in the configuration file for one of the cluster nodes. Therefore, a corresponding revision of the mariabackup SST script was made, which provides reading of the corresponding parameter from the configuration file or from the command line. https://jira.mariadb.org/browse/MDEV-17848
1 parent b6f2039 commit d48ac8b

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

scripts/wsrep_sst_mariabackup.sh

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,30 @@ fi
678678

679679
INNOEXTRA=""
680680

681+
INNODB_DATA_HOME_DIR=${INNODB_DATA_HOME_DIR:-""}
682+
# Try to set INNODB_DATA_HOME_DIR from the command line:
683+
if [ ! -z "$INNODB_DATA_HOME_DIR_ARG" ]; then
684+
INNODB_DATA_HOME_DIR=$INNODB_DATA_HOME_DIR_ARG
685+
fi
686+
# if INNODB_DATA_HOME_DIR env. variable is not set, try to get it from my.cnf
687+
if [ -z "$INNODB_DATA_HOME_DIR" ]; then
688+
INNODB_DATA_HOME_DIR=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-data-home-dir '')
689+
fi
690+
if [ -z "$INNODB_DATA_HOME_DIR" ]; then
691+
INNODB_DATA_HOME_DIR=$(parse_cnf --mysqld innodb-data-home-dir "")
692+
fi
693+
if [ ! -z "$INNODB_DATA_HOME_DIR" ]; then
694+
INNOEXTRA+=" --innodb-data-home-dir=$INNODB_DATA_HOME_DIR"
695+
fi
696+
697+
if [ -n "$INNODB_DATA_HOME_DIR" ]; then
698+
# handle both relative and absolute paths
699+
INNODB_DATA_HOME_DIR=$(cd $DATA; mkdir -p "$INNODB_DATA_HOME_DIR"; cd $INNODB_DATA_HOME_DIR; pwd -P)
700+
else
701+
# default to datadir
702+
INNODB_DATA_HOME_DIR=$(cd $DATA; pwd -P)
703+
fi
704+
681705
if [[ $ssyslog -eq 1 ]];then
682706

683707
if ! command -v logger >/dev/null;then
@@ -698,13 +722,13 @@ if [[ $ssyslog -eq 1 ]];then
698722
logger -p daemon.info -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE "$@"
699723
}
700724

701-
INNOAPPLY="${INNOBACKUPEX_BIN} --innobackupex $disver $iapts --apply-log \$rebuildcmd \${DATA} 2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-apply "
725+
INNOAPPLY="${INNOBACKUPEX_BIN} --innobackupex $disver $iapts \$INNOEXTRA --apply-log \$rebuildcmd \${DATA} 2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-apply "
702726
INNOMOVE="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $impts --move-back --force-non-empty-directories \${DATA} 2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-move "
703727
INNOBACKUP="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2> >(logger -p daemon.err -t ${ssystag}innobackupex-backup)"
704728
fi
705729

706730
else
707-
INNOAPPLY="${INNOBACKUPEX_BIN} --innobackupex $disver $iapts --apply-log \$rebuildcmd \${DATA} &>\${DATA}/innobackup.prepare.log"
731+
INNOAPPLY="${INNOBACKUPEX_BIN} --innobackupex $disver $iapts \$INNOEXTRA --apply-log \$rebuildcmd \${DATA} &>\${DATA}/innobackup.prepare.log"
708732
INNOMOVE="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $impts --move-back --force-non-empty-directories \${DATA} &>\${DATA}/innobackup.move.log"
709733
INNOBACKUP="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2>\${DATA}/innobackup.backup.log"
710734
fi
@@ -847,7 +871,7 @@ then
847871
[[ -e $SST_PROGRESS_FILE ]] && wsrep_log_info "Stale sst_in_progress file: $SST_PROGRESS_FILE"
848872
[[ -n $SST_PROGRESS_FILE ]] && touch $SST_PROGRESS_FILE
849873

850-
ib_home_dir=$(parse_cnf mysqld innodb-data-home-dir "")
874+
ib_home_dir=$INNODB_DATA_HOME_DIR
851875
ib_log_dir=$(parse_cnf mysqld innodb-log-group-home-dir "")
852876
ib_undo_dir=$(parse_cnf mysqld innodb-undo-directory "")
853877

0 commit comments

Comments
 (0)