summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-04-21 11:33:59 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-04-21 11:33:59 +0300
commit394784095eeedb3a2915249fe14a9d2e1f91a23a (patch)
tree0a2e7ad98bfa382744d87c6af6eb91f4bfc3858d /scripts
parentd7189fbcb4dadf23d615a5f3a26aba1d4e37178f (diff)
parent4730314a70119ae5857edffe2d1bec86960ef22b (diff)
downloadmariadb-git-394784095eeedb3a2915249fe14a9d2e1f91a23a.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'scripts')
-rw-r--r--scripts/wsrep_sst_mariabackup.sh31
1 files changed, 23 insertions, 8 deletions
diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh
index 067a777fb9c..87ed8392475 100644
--- a/scripts/wsrep_sst_mariabackup.sh
+++ b/scripts/wsrep_sst_mariabackup.sh
@@ -535,7 +535,14 @@ read_cnf()
ssystag=$(parse_cnf mysqld_safe syslog-tag "${SST_SYSLOG_TAG:-}")
ssystag="$ssystag-"
sstlogarchive=$(parse_cnf sst sst-log-archive 1)
- sstlogarchivedir=$(parse_cnf sst sst-log-archive-dir '/tmp/sst_log_archive')
+ sstlogarchivedir=""
+ if [ $sstlogarchive -ne 0 ]; then
+ sstlogarchivedir=$(parse_cnf sst sst-log-archive-dir \
+ '/tmp/sst_log_archive')
+ if [ -n "$sstlogarchivedir" ]; then
+ sstlogarchivedir=$(trim_dir "$sstlogarchivedir")
+ fi
+ fi
if [ $speciald -eq 0 ]; then
wsrep_log_error \
@@ -879,7 +886,15 @@ else
if [ -n "$sstlogarchivedir" ]; then
if [ ! -d "$sstlogarchivedir" ]; then
- mkdir -p "$sstlogarchivedir"
+ if ! mkdir -p "$sstlogarchivedir"; then
+ sstlogarchivedir=""
+ wsrep_log_warning \
+ "Unable to create '$sstlogarchivedir' directory"
+ fi
+ elif [ ! -w "$sstlogarchivedir" ]; then
+ sstlogarchivedir=""
+ wsrep_log_warning \
+ "The '$sstlogarchivedir' directory is not writtable"
fi
fi
@@ -891,8 +906,8 @@ else
newfile="$INNOAPPLYLOG.$ARCHIVETIMESTAMP"
fi
wsrep_log_info "Moving '$INNOAPPLYLOG' to '$newfile'"
- mv "$INNOAPPLYLOG" "$newfile"
- gzip "$newfile"
+ mv "$INNOAPPLYLOG" "$newfile" && gzip "$newfile" || \
+ wsrep_log_warning "Failed to archive log file ('$newfile')"
fi
if [ -e "$INNOMOVELOG" ]; then
@@ -903,8 +918,8 @@ else
newfile="$INNOMOVELOG.$ARCHIVETIMESTAMP"
fi
wsrep_log_info "Moving '$INNOMOVELOG' to '$newfile'"
- mv "$INNOMOVELOG" "$newfile"
- gzip "$newfile"
+ mv "$INNOMOVELOG" "$newfile" && gzip "$newfile" || \
+ wsrep_log_warning "Failed to archive log file ('$newfile')"
fi
if [ -e "$INNOBACKUPLOG" ]; then
@@ -915,8 +930,8 @@ else
newfile="$INNOBACKUPLOG.$ARCHIVETIMESTAMP"
fi
wsrep_log_info "Moving '$INNOBACKUPLOG' to '$newfile'"
- mv "$INNOBACKUPLOG" "$newfile"
- gzip "$newfile"
+ mv "$INNOBACKUPLOG" "$newfile" && gzip "$newfile" || \
+ wsrep_log_warning "Failed to archive log file ('$newfile')"
fi
fi
INNOAPPLY="> '$INNOAPPLYLOG' 2>&1"