Commit e093e5ab authored by Daniel Black's avatar Daniel Black

MDEV-30276 - wsrep_sst_mariabackup to use mariadb-backup

rather than mariabackup internally, and change and messages accordingly.
parent 402f36dd
...@@ -95,9 +95,9 @@ sst_ver=1 ...@@ -95,9 +95,9 @@ sst_ver=1
declare -a RC declare -a RC
BACKUP_BIN=$(commandex 'mariabackup') BACKUP_BIN=$(commandex 'mariadb-backup')
if [ -z "$BACKUP_BIN" ]; then if [ -z "$BACKUP_BIN" ]; then
wsrep_log_error 'mariabackup binary not found in path' wsrep_log_error 'mariadb-backup binary not found in path'
exit 42 exit 42
fi fi
...@@ -685,7 +685,7 @@ cleanup_at_exit() ...@@ -685,7 +685,7 @@ cleanup_at_exit()
if [ -n "$BACKUP_PID" ]; then if [ -n "$BACKUP_PID" ]; then
if check_pid "$BACKUP_PID" 1; then if check_pid "$BACKUP_PID" 1; then
wsrep_log_error \ wsrep_log_error \
"mariabackup process is still running. Killing..." "mariadb-backup process is still running. Killing..."
cleanup_pid $CHECK_PID "$BACKUP_PID" cleanup_pid $CHECK_PID "$BACKUP_PID"
fi fi
fi fi
...@@ -761,7 +761,7 @@ check_extra() ...@@ -761,7 +761,7 @@ check_extra()
if [ "$thread_handling" = 'pool-of-threads' ]; then if [ "$thread_handling" = 'pool-of-threads' ]; then
local eport=$(parse_cnf '--mysqld' 'extra-port') local eport=$(parse_cnf '--mysqld' 'extra-port')
if [ -n "$eport" ]; then if [ -n "$eport" ]; then
# mariabackup works only locally. # mariadb-backup works only locally.
# Hence, setting host to 127.0.0.1 unconditionally: # Hence, setting host to 127.0.0.1 unconditionally:
wsrep_log_info "SST through extra_port $eport" wsrep_log_info "SST through extra_port $eport"
INNOEXTRA="$INNOEXTRA --host=127.0.0.1 --port=$eport" INNOEXTRA="$INNOEXTRA --host=127.0.0.1 --port=$eport"
...@@ -930,7 +930,7 @@ cd "$OLD_PWD" ...@@ -930,7 +930,7 @@ cd "$OLD_PWD"
if [ $ssyslog -eq 1 ]; then if [ $ssyslog -eq 1 ]; then
if [ -n "$(commandex logger)" ]; then if [ -n "$(commandex logger)" ]; then
wsrep_log_info "Logging all stderr of SST/mariabackup to syslog" wsrep_log_info "Logging all stderr of SST/mariadb-backup to syslog"
exec 2> >(logger -p daemon.err -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE) exec 2> >(logger -p daemon.err -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE)
...@@ -1053,11 +1053,11 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then ...@@ -1053,11 +1053,11 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
xtmpdir=$(TMPDIR="$tmpdir"; mktemp '-d') xtmpdir=$(TMPDIR="$tmpdir"; mktemp '-d')
fi fi
wsrep_log_info "Using '$xtmpdir' as mariabackup temporary directory" wsrep_log_info "Using '$xtmpdir' as mariadb-backup temporary directory"
tmpopts=" --tmpdir='$xtmpdir'" tmpopts=" --tmpdir='$xtmpdir'"
itmpdir="$(mktemp -d)" itmpdir="$(mktemp -d)"
wsrep_log_info "Using '$itmpdir' as mariabackup working directory" wsrep_log_info "Using '$itmpdir' as mariadb-abackup working directory"
usrst=0 usrst=0
if [ -n "$WSREP_SST_OPT_USER" ]; then if [ -n "$WSREP_SST_OPT_USER" ]; then
...@@ -1148,7 +1148,7 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then ...@@ -1148,7 +1148,7 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
fi fi
# if compression is enabled for backup files, then add the # if compression is enabled for backup files, then add the
# appropriate options to the mariabackup command line: # appropriate options to the mariadb-backup command line:
if [ "$compress" != 'none' ]; then if [ "$compress" != 'none' ]; then
iopts="--compress${compress:+=$compress}${iopts:+ }$iopts" iopts="--compress${compress:+=$compress}${iopts:+ }$iopts"
if [ -n "$compress_threads" ]; then if [ -n "$compress_threads" ]; then
...@@ -1170,7 +1170,7 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then ...@@ -1170,7 +1170,7 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
set -e set -e
if [ ${RC[0]} -ne 0 ]; then if [ ${RC[0]} -ne 0 ]; then
wsrep_log_error "mariabackup finished with error: ${RC[0]}." \ wsrep_log_error "mariadb-backup finished with error: ${RC[0]}." \
"Check syslog or '$INNOBACKUPLOG' for details" "Check syslog or '$INNOBACKUPLOG' for details"
exit 22 exit 22
elif [ ${RC[$(( ${#RC[@]}-1 ))]} -eq 1 ]; then elif [ ${RC[$(( ${#RC[@]}-1 ))]} -eq 1 ]; then
...@@ -1178,7 +1178,7 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then ...@@ -1178,7 +1178,7 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
exit 22 exit 22
fi fi
# mariabackup implicitly writes PID to fixed location in $xtmpdir # mariadb-backup implicitly writes PID to fixed location in $xtmpdir
BACKUP_PID="$xtmpdir/xtrabackup_pid" BACKUP_PID="$xtmpdir/xtrabackup_pid"
else # BYPASS FOR IST else # BYPASS FOR IST
...@@ -1450,14 +1450,14 @@ else # joiner ...@@ -1450,14 +1450,14 @@ else # joiner
if [ ! -s "$DATA/xtrabackup_checkpoints" ]; then if [ ! -s "$DATA/xtrabackup_checkpoints" ]; then
wsrep_log_error "xtrabackup_checkpoints missing," \ wsrep_log_error "xtrabackup_checkpoints missing," \
"failed mariabackup/SST on donor" "failed mariadb-backup/SST on donor"
exit 2 exit 2
fi fi
# Compact backups are not supported by mariabackup # Compact backups are not supported by mariadb-backup
if grep -qw -F 'compact = 1' "$DATA/xtrabackup_checkpoints"; then if grep -qw -F 'compact = 1' "$DATA/xtrabackup_checkpoints"; then
wsrep_log_info "Index compaction detected" wsrep_log_info "Index compaction detected"
wsrel_log_error "Compact backups are not supported by mariabackup" wsrel_log_error "Compact backups are not supported by mariadb-backup"
exit 2 exit 2
fi fi
...@@ -1509,9 +1509,9 @@ else # joiner ...@@ -1509,9 +1509,9 @@ else # joiner
wsrep_log_info "Preparing the backup at $DATA" wsrep_log_info "Preparing the backup at $DATA"
setup_commands setup_commands
timeit 'mariabackup prepare stage' "$INNOAPPLY" timeit 'mariadb-backup prepare stage' "$INNOAPPLY"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
wsrep_log_error "mariabackup apply finished with errors." \ wsrep_log_error "mariadb-backup apply finished with errors." \
"Check syslog or '$INNOAPPLYLOG' for details." "Check syslog or '$INNOAPPLYLOG' for details."
exit 22 exit 22
fi fi
...@@ -1556,7 +1556,7 @@ else # joiner ...@@ -1556,7 +1556,7 @@ else # joiner
MAGIC_FILE="$TDATA/$INFO_FILE" MAGIC_FILE="$TDATA/$INFO_FILE"
wsrep_log_info "Moving the backup to $TDATA" wsrep_log_info "Moving the backup to $TDATA"
timeit 'mariabackup move stage' "$INNOMOVE" timeit 'mariadb-backup move stage' "$INNOMOVE"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
wsrep_log_info "Move successful, removing $DATA" wsrep_log_info "Move successful, removing $DATA"
rm -rf "$DATA" rm -rf "$DATA"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment