diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-08-28 15:23:21 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-08-28 15:23:21 +0300 |
commit | 5f35e103ee667b8596efbd138819af8dedd93ed5 (patch) | |
tree | c01e53829e93076958e2c5f625b5bc34f33c12b3 /scripts | |
parent | 9cd6e7ad73554be6d0186a42f983777a90a984f1 (diff) | |
parent | 4ba20e0a14b9134a7e71aa4b592522967456317c (diff) | |
download | mariadb-git-5f35e103ee667b8596efbd138819af8dedd93ed5.tar.gz |
Merge 10.1 into 10.2
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/wsrep_sst_common.sh | 18 | ||||
-rw-r--r-- | scripts/wsrep_sst_mariabackup.sh | 26 | ||||
-rw-r--r-- | scripts/wsrep_sst_xtrabackup-v2.sh | 47 | ||||
-rw-r--r-- | scripts/wsrep_sst_xtrabackup.sh | 14 |
4 files changed, 71 insertions, 34 deletions
diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh index b27261cf4b4..ee7817a1550 100644 --- a/scripts/wsrep_sst_common.sh +++ b/scripts/wsrep_sst_common.sh @@ -166,7 +166,11 @@ case "$1" in shift while [ $# -gt 0 ]; do option=${1%%=*} - if [ "$option" != "--defaults-file" ]; then + if [[ "$option" != "--defaults-file" && \ + "$option" != "--defaults-extra-file" && \ + "$option" != "--defaults-group-suffix" && \ + "$option" != "--port" && \ + "$option" != "--socket" ]]; then value=${1#*=} case "$option" in '--innodb-data-home-dir') @@ -193,7 +197,7 @@ case "$1" in if [ -z "$original_cmd" ]; then original_cmd="$1" else - original_cmd+=" $1" + original_cmd="$original_cmd $1" fi fi shift @@ -249,7 +253,15 @@ else MY_PRINT_DEFAULTS=$(which my_print_defaults) fi -readonly WSREP_SST_OPT_CONF="$WSREP_SST_OPT_DEFAULT $WSREP_SST_OPT_EXTRA_DEFAULT $WSREP_SST_OPT_SUFFIX_DEFAULT" +wsrep_defaults="$WSREP_SST_OPT_DEFAULT" +if [ -n "$wsrep_defaults" ]; then + wsrep_defaults="$wsrep_defaults " +fi +wsrep_defaults="$wsrep_defaults$WSREP_SST_OPT_EXTRA_DEFAULT" +if [ -n "$wsrep_defaults" ]; then + wsrep_defaults="$wsrep_defaults " +fi +readonly WSREP_SST_OPT_CONF="$wsrep_defaults$WSREP_SST_OPT_SUFFIX_DEFAULT" readonly MY_PRINT_DEFAULTS="$MY_PRINT_DEFAULTS $WSREP_SST_OPT_CONF" wsrep_auth_not_set() diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh index abcfa0aea35..9dff0f1aa9c 100644 --- a/scripts/wsrep_sst_mariabackup.sh +++ b/scripts/wsrep_sst_mariabackup.sh @@ -60,7 +60,7 @@ rebuild=0 rebuildcmd="" payload=0 pvformat="-F '%N => Rate:%r Avg:%a Elapsed:%t %e Bytes: %b %p' " -pvopts="-f -i 10 -N $WSREP_SST_OPT_ROLE " +pvopts="-f -i 10 -N $WSREP_SST_OPT_ROLE " STATDIR="" uextra=0 disver="" @@ -130,7 +130,7 @@ get_keys() if [[ $encrypt -eq 0 ]];then if $MY_PRINT_DEFAULTS xtrabackup | grep -q encrypt;then - wsrep_log_error "Unexpected option combination. SST may fail. Refer to http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html " + wsrep_log_error "Unexpected option combination. SST may fail. Refer to http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html" fi return fi @@ -465,7 +465,7 @@ cleanup_donor() if [[ -n ${XTRABACKUP_PID:-} ]];then if check_pid $XTRABACKUP_PID then - wsrep_log_error "xtrabackup process is still running. Killing... " + wsrep_log_error "xtrabackup process is still running. Killing..." kill_xtrabackup fi @@ -567,7 +567,7 @@ check_extra() # Xtrabackup works only locally. # Hence, setting host to 127.0.0.1 unconditionally. wsrep_log_info "SST through extra_port $eport" - INNOEXTRA+=" --host=127.0.0.1 --port=$eport " + INNOEXTRA+=" --host=127.0.0.1 --port=$eport" use_socket=0 else wsrep_log_error "Extra port $eport null, failing" @@ -577,8 +577,8 @@ check_extra() wsrep_log_info "Thread pool not set, ignore the option use_extra" fi fi - if [[ $use_socket -eq 1 ]] && [[ -n "${WSREP_SST_OPT_SOCKET}" ]];then - INNOEXTRA+=" --socket=${WSREP_SST_OPT_SOCKET}" + if [[ $use_socket -eq 1 ]] && [[ -n "$WSREP_SST_OPT_SOCKET" ]];then + INNOEXTRA+=" --socket=$WSREP_SST_OPT_SOCKET" fi } @@ -744,8 +744,8 @@ if [[ $ssyslog -eq 1 ]];then logger -p daemon.info -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE "$@" } - 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 " + 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 @@ -833,7 +833,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 @@ -855,13 +855,12 @@ then get_keys if [[ $encrypt -eq 1 ]];then if [[ -n $ekey ]];then - INNOEXTRA+=" --encrypt=$ealgo --encrypt-key=$ekey " + INNOEXTRA+=" --encrypt=$ealgo --encrypt-key=$ekey" else - INNOEXTRA+=" --encrypt=$ealgo --encrypt-key-file=$ekeyfile " + INNOEXTRA+=" --encrypt=$ealgo --encrypt-key-file=$ekeyfile" fi fi - check_extra wsrep_log_info "Streaming GTID file before SST" @@ -882,7 +881,6 @@ then tcmd=" $scomp | $tcmd " fi - send_donor $DATA "${stagemsg}-gtid" tcmd="$ttcmd" @@ -1050,7 +1048,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 8e353c24deb..75601e5c180 100644 --- a/scripts/wsrep_sst_xtrabackup-v2.sh +++ b/scripts/wsrep_sst_xtrabackup-v2.sh @@ -56,7 +56,7 @@ rebuild=0 rebuildcmd="" payload=0 pvformat="-F '%N => Rate:%r Avg:%a Elapsed:%t %e Bytes: %b %p' " -pvopts="-f -i 10 -N $WSREP_SST_OPT_ROLE " +pvopts="-f -i 10 -N $WSREP_SST_OPT_ROLE " STATDIR="" uextra=0 disver="" @@ -675,7 +675,7 @@ check_extra() # Xtrabackup works only locally. # Hence, setting host to 127.0.0.1 unconditionally. wsrep_log_info "SST through extra_port $eport" - INNOEXTRA+=" --host=127.0.0.1 --port=$eport " + INNOEXTRA+=" --host=127.0.0.1 --port=$eport" use_socket=0 else wsrep_log_error "Extra port $eport null, failing" @@ -685,8 +685,8 @@ check_extra() wsrep_log_info "Thread pool not set, ignore the option use_extra" fi fi - if [[ $use_socket -eq 1 ]] && [[ -n "${WSREP_SST_OPT_SOCKET}" ]];then - INNOEXTRA+=" --socket=${WSREP_SST_OPT_SOCKET}" + if [[ $use_socket -eq 1 ]] && [[ -n "$WSREP_SST_OPT_SOCKET" ]];then + INNOEXTRA+=" --socket=$WSREP_SST_OPT_SOCKET" fi } @@ -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) diff --git a/scripts/wsrep_sst_xtrabackup.sh b/scripts/wsrep_sst_xtrabackup.sh index 485e071bd35..c4feac2a135 100644 --- a/scripts/wsrep_sst_xtrabackup.sh +++ b/scripts/wsrep_sst_xtrabackup.sh @@ -49,7 +49,7 @@ rebuild=0 rebuildcmd="" payload=0 pvformat="-F '%N => Rate:%r Avg:%a Elapsed:%t %e Bytes: %b %p' " -pvopts="-f -i 10 -N $WSREP_SST_OPT_ROLE " +pvopts="-f -i 10 -N $WSREP_SST_OPT_ROLE " uextra=0 if which pv &>/dev/null && pv --help | grep -q FORMAT;then @@ -380,7 +380,7 @@ check_extra() # Xtrabackup works only locally. # Hence, setting host to 127.0.0.1 unconditionally. wsrep_log_info "SST through extra_port $eport" - INNOEXTRA+=" --host=127.0.0.1 --port=$eport " + INNOEXTRA+=" --host=127.0.0.1 --port=$eport" use_socket=0 else wsrep_log_error "Extra port $eport null, failing" @@ -390,8 +390,8 @@ check_extra() wsrep_log_info "Thread pool not set, ignore the option use_extra" fi fi - if [[ $use_socket -eq 1 ]] && [[ -n "${WSREP_SST_OPT_SOCKET}" ]];then - INNOEXTRA+=" --socket=${WSREP_SST_OPT_SOCKET}" + if [[ $use_socket -eq 1 ]] && [[ -n "$WSREP_SST_OPT_SOCKET" ]];then + INNOEXTRA+=" --socket=$WSREP_SST_OPT_SOCKET" fi } @@ -439,14 +439,14 @@ then get_keys if [[ $encrypt -eq 1 ]];then if [[ -n $ekey ]];then - INNOEXTRA+=" --encrypt=$ealgo --encrypt-key=$ekey " + INNOEXTRA+=" --encrypt=$ealgo --encrypt-key=$ekey" else - INNOEXTRA+=" --encrypt=$ealgo --encrypt-key-file=$ekeyfile " + INNOEXTRA+=" --encrypt=$ealgo --encrypt-key-file=$ekeyfile" fi fi if [[ -n $lsn ]];then - INNOEXTRA+=" --incremental --incremental-lsn=$lsn " + INNOEXTRA+=" --incremental --incremental-lsn=$lsn" fi check_extra |