diff options
author | Julius Goryavsky <julius.goryavsky@mariadb.com> | 2019-08-28 04:49:01 +0200 |
---|---|---|
committer | Julius Goryavsky <julius.goryavsky@mariadb.com> | 2019-08-28 12:13:41 +0200 |
commit | 4ba20e0a14b9134a7e71aa4b592522967456317c (patch) | |
tree | d935d8e6a98c6354060a1675c96fb46cf2658a7a | |
parent | d4866c7d0db3183b6b3d828130ccd8fb9a98600b (diff) | |
download | mariadb-git-4ba20e0a14b9134a7e71aa4b592522967456317c.tar.gz |
Improved handling of subdirectories in the xtrabackup-v2 SST scripts (similar to MDEV-18863) for more predictable test results (related to xtrabackup-v2 SST)
-rw-r--r-- | scripts/wsrep_sst_mariabackup.sh | 4 | ||||
-rw-r--r-- | scripts/wsrep_sst_xtrabackup-v2.sh | 39 |
2 files changed, 35 insertions, 8 deletions
diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh index 0aedb723072..cb4cb3bd1d4 100644 --- a/scripts/wsrep_sst_mariabackup.sh +++ b/scripts/wsrep_sst_mariabackup.sh @@ -834,7 +834,7 @@ then -z $(parse_cnf --mysqld tmpdir "") && \ -z $(parse_cnf xtrabackup tmpdir "") ]]; then xtmpdir=$(mktemp -d) - tmpopts=" --tmpdir=$xtmpdir " + tmpopts=" --tmpdir=$xtmpdir" wsrep_log_info "Using $xtmpdir as xtrabackup temporary directory" fi @@ -1049,7 +1049,7 @@ then tempdir=$LOG_BIN_ARG if [ -z "$tempdir" ]; then - tempdir=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE log-bin "") + tempdir=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE log-bin "") fi if [ -z "$tempdir" ]; then tempdir=$(parse_cnf --mysqld log-bin "") diff --git a/scripts/wsrep_sst_xtrabackup-v2.sh b/scripts/wsrep_sst_xtrabackup-v2.sh index 41e66db63fb..75601e5c180 100644 --- a/scripts/wsrep_sst_xtrabackup-v2.sh +++ b/scripts/wsrep_sst_xtrabackup-v2.sh @@ -906,7 +906,10 @@ if [ ! -z "$INNODB_DATA_HOME_DIR_ARG" ]; then 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 innodb-data-home-dir "") + 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" @@ -937,9 +940,11 @@ then exit 93 fi - if [[ -z $(parse_cnf --mysqld tmpdir "") && -z $(parse_cnf xtrabackup tmpdir "") ]];then + if [[ -z $(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE tmpdir "") && \ + -z $(parse_cnf --mysqld tmpdir "") && \ + -z $(parse_cnf xtrabackup tmpdir "") ]]; then xtmpdir=$(mktemp -d) - tmpopts=" --tmpdir=$xtmpdir " + tmpopts=" --tmpdir=$xtmpdir" wsrep_log_info "Using $xtmpdir as xtrabackup temporary directory" fi @@ -1057,8 +1062,24 @@ then [[ -n $SST_PROGRESS_FILE ]] && touch $SST_PROGRESS_FILE 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 "") + + # Try to set ib_log_dir from the command line: + ib_log_dir=$INNODB_LOG_GROUP_HOME_ARG + if [ -z "$ib_log_dir" ]; then + ib_log_dir=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-log-group-home-dir "") + fi + if [ -z "$ib_log_dir" ]; then + ib_log_dir=$(parse_cnf --mysqld innodb-log-group-home-dir "") + fi + + # Try to set ib_undo_dir from the command line: + ib_undo_dir=$INNODB_UNDO_DIR_ARG + if [ -z "$ib_undo_dir" ]; then + ib_undo_dir=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-undo-directory "") + fi + if [ -z "$ib_undo_dir" ]; then + ib_undo_dir=$(parse_cnf --mysqld innodb-undo-directory "") + fi stagemsg="Joiner-Recv" @@ -1124,7 +1145,13 @@ then find $ib_home_dir $ib_log_dir $ib_undo_dir $DATA -mindepth 1 -prune -regex $cpat -o -exec rm -rfv {} 1>&2 \+ fi - tempdir=$(parse_cnf --mysqld log-bin "") + tempdir=$LOG_BIN_ARG + if [ -z "$tempdir" ]; then + tempdir=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE log-bin "") + fi + if [ -z "$tempdir" ]; then + tempdir=$(parse_cnf --mysqld log-bin "") + fi if [[ -n ${tempdir:-} ]];then binlog_dir=$(dirname $tempdir) binlog_file=$(basename $tempdir) |