summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorBrave Galera Crew <devel@codership.com>2019-01-23 15:30:00 +0400
committerSergey Vojtovich <svoj@mariadb.org>2019-01-23 15:30:00 +0400
commit36a2a185fe18d31a644da46cfabd9757a379280c (patch)
tree00ca186ce2cfdc3ab7e4979336a384e2b51c5aa9 /scripts
parent382115b99297ceaa4c3067f79efb5c2515013be5 (diff)
downloadmariadb-git-36a2a185fe18d31a644da46cfabd9757a379280c.tar.gz
Galera4
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysqld_safe.sh11
-rwxr-xr-xscripts/wsrep_sst_common.sh2
-rw-r--r--scripts/wsrep_sst_mysqldump.sh5
-rw-r--r--scripts/wsrep_sst_rsync.sh10
4 files changed, 20 insertions, 8 deletions
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index 5797bdc68d7..5f09ac3c235 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -265,7 +265,16 @@ wsrep_recover_position() {
wsrep_start_position_opt="--wsrep_start_position=$start_pos"
fi
- [ $ret -eq 0 ] && rm $wr_logfile
+ if [ $ret -eq 0 ] ; then
+ local wr_logfile_permanent="$DATADIR/wsrep_recovery.ok"
+ else
+ local wr_logfile_permanent="$DATADIR/wsrep_recovery.fail"
+ fi
+ touch $wr_logfile_permanent
+ [ "$euid" = "0" ] && chown $user $wr_logfile_permanent
+ chmod 600 $wr_logfile_permanent
+ cat "$wr_logfile" >> $wr_logfile_permanent
+ rm -f "$wr_logfile"
return $ret
}
diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh
index 5683b166163..321826b1975 100755
--- a/scripts/wsrep_sst_common.sh
+++ b/scripts/wsrep_sst_common.sh
@@ -50,7 +50,7 @@ case "$1" in
readonly WSREP_SST_OPT_HOST_UNESCAPED=$WSREP_SST_OPT_HOST
;;
esac
- remain=${WSREP_SST_OPT_ADDR#${WSREP_SST_OPT_HOST}}
+ remain=${WSREP_SST_OPT_ADDR#"${WSREP_SST_OPT_HOST}"}
remain=${remain#:}
readonly WSREP_SST_OPT_ADDR_PORT=${remain%%/*}
remain=${remain#*/}
diff --git a/scripts/wsrep_sst_mysqldump.sh b/scripts/wsrep_sst_mysqldump.sh
index faa3f10639b..d36deb5759f 100644
--- a/scripts/wsrep_sst_mysqldump.sh
+++ b/scripts/wsrep_sst_mysqldump.sh
@@ -25,6 +25,7 @@ EINVAL=22
local_ip()
{
[ "$1" = "127.0.0.1" ] && return 0
+ [ "$1" = "127.0.0.2" ] && return 0
[ "$1" = "localhost" ] && return 0
[ "$1" = "[::1]" ] && return 0
[ "$1" = "$(hostname -s)" ] && return 0
@@ -138,8 +139,8 @@ then
# turned off for the session so that gtid state does not get altered while
# the dump gets replayed on joiner.
if [[ "$LOG_BIN" == 'ON' ]]; then
- RESET_MASTER="RESET MASTER;"
- SET_GTID_BINLOG_STATE="SET @@global.gtid_binlog_state='$GTID_BINLOG_STATE';"
+ RESET_MASTER="SET GLOBAL wsrep_on=OFF; RESET MASTER; SET GLOBAL wsrep_on=ON;"
+ SET_GTID_BINLOG_STATE="SET GLOBAL wsrep_on=OFF; SET @@global.gtid_binlog_state='$GTID_BINLOG_STATE'; SET GLOBAL wsrep_on=ON;"
SQL_LOG_BIN_OFF="SET @@session.sql_log_bin=OFF;"
fi
fi
diff --git a/scripts/wsrep_sst_rsync.sh b/scripts/wsrep_sst_rsync.sh
index 6417ee7f704..12fb9d3ba38 100644
--- a/scripts/wsrep_sst_rsync.sh
+++ b/scripts/wsrep_sst_rsync.sh
@@ -269,8 +269,9 @@ EOF
cd $BINLOG_DIRNAME
if ! [ -z $WSREP_SST_OPT_BINLOG_INDEX ]
- binlog_files_full=$(tail -n $BINLOG_N_FILES ${BINLOG_FILENAME}.index)
then
+ binlog_files_full=$(tail -n $BINLOG_N_FILES ${BINLOG_FILENAME}.index)
+ else
cd $BINLOG_INDEX_DIRNAME
binlog_files_full=$(tail -n $BINLOG_N_FILES ${BINLOG_INDEX_FILENAME}.index)
fi
@@ -508,9 +509,10 @@ EOF
for ii in $(ls -1 ${BINLOG_FILENAME}.*)
do
if ! [ -z $WSREP_SST_OPT_BINLOG_INDEX ]
- echo ${BINLOG_DIRNAME}/${ii} >> ${BINLOG_FILENAME}.index
- then
- echo ${BINLOG_DIRNAME}/${ii} >> ${BINLOG_INDEX_DIRNAME}/${BINLOG_INDEX_FILENAME}.index
+ then
+ echo ${BINLOG_DIRNAME}/${ii} >> ${BINLOG_FILENAME}.index
+ else
+ echo ${BINLOG_DIRNAME}/${ii} >> ${BINLOG_INDEX_DIRNAME}/${BINLOG_INDEX_FILENAME}.index
fi
done
fi