diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2018-12-17 13:28:23 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2018-12-17 13:28:23 +0200 |
commit | f01cc3f33f42af98f5ef778d17037bbefb821d60 (patch) | |
tree | bc7c8271390838f9d809389857805ede20837305 | |
parent | 5fefcb0a2136e419d194f8b7b846adb0697fb23a (diff) | |
parent | d48ac8b414d6ada00fb3f9b904266954de9cf6de (diff) | |
download | mariadb-git-f01cc3f33f42af98f5ef778d17037bbefb821d60.tar.gz |
Merge branch 'sysprg/MDEV-17848' of https://github.com/tempesta-tech/mariadb into tempesta-tech-sysprg/MDEV-17848
-rw-r--r-- | scripts/wsrep_sst_mariabackup.sh | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh index 8173db26291..bc875a0dc03 100644 --- a/scripts/wsrep_sst_mariabackup.sh +++ b/scripts/wsrep_sst_mariabackup.sh @@ -678,6 +678,30 @@ fi INNOEXTRA="" +INNODB_DATA_HOME_DIR=${INNODB_DATA_HOME_DIR:-""} +# Try to set INNODB_DATA_HOME_DIR from the command line: +if [ ! -z "$INNODB_DATA_HOME_DIR_ARG" ]; then + INNODB_DATA_HOME_DIR=$INNODB_DATA_HOME_DIR_ARG +fi +# if INNODB_DATA_HOME_DIR env. variable is not set, try to get it from my.cnf +if [ -z "$INNODB_DATA_HOME_DIR" ]; then + INNODB_DATA_HOME_DIR=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-data-home-dir '') +fi +if [ -z "$INNODB_DATA_HOME_DIR" ]; then + INNODB_DATA_HOME_DIR=$(parse_cnf --mysqld innodb-data-home-dir "") +fi +if [ ! -z "$INNODB_DATA_HOME_DIR" ]; then + INNOEXTRA+=" --innodb-data-home-dir=$INNODB_DATA_HOME_DIR" +fi + +if [ -n "$INNODB_DATA_HOME_DIR" ]; then + # handle both relative and absolute paths + INNODB_DATA_HOME_DIR=$(cd $DATA; mkdir -p "$INNODB_DATA_HOME_DIR"; cd $INNODB_DATA_HOME_DIR; pwd -P) +else + # default to datadir + INNODB_DATA_HOME_DIR=$(cd $DATA; pwd -P) +fi + if [[ $ssyslog -eq 1 ]];then if ! command -v logger >/dev/null;then @@ -698,13 +722,13 @@ if [[ $ssyslog -eq 1 ]];then logger -p daemon.info -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE "$@" } - INNOAPPLY="${INNOBACKUPEX_BIN} --innobackupex $disver $iapts --apply-log \$rebuildcmd \${DATA} 2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-apply " + INNOAPPLY="${INNOBACKUPEX_BIN} --innobackupex $disver $iapts \$INNOEXTRA --apply-log \$rebuildcmd \${DATA} 2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-apply " 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 " 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)" fi else - INNOAPPLY="${INNOBACKUPEX_BIN} --innobackupex $disver $iapts --apply-log \$rebuildcmd \${DATA} &>\${DATA}/innobackup.prepare.log" + INNOAPPLY="${INNOBACKUPEX_BIN} --innobackupex $disver $iapts \$INNOEXTRA --apply-log \$rebuildcmd \${DATA} &>\${DATA}/innobackup.prepare.log" INNOMOVE="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $impts --move-back --force-non-empty-directories \${DATA} &>\${DATA}/innobackup.move.log" INNOBACKUP="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2>\${DATA}/innobackup.backup.log" fi @@ -847,7 +871,7 @@ then [[ -e $SST_PROGRESS_FILE ]] && wsrep_log_info "Stale sst_in_progress file: $SST_PROGRESS_FILE" [[ -n $SST_PROGRESS_FILE ]] && touch $SST_PROGRESS_FILE - ib_home_dir=$(parse_cnf mysqld innodb-data-home-dir "") + ib_home_dir=$INNODB_DATA_HOME_DIR ib_log_dir=$(parse_cnf mysqld innodb-log-group-home-dir "") ib_undo_dir=$(parse_cnf mysqld innodb-undo-directory "") |