From 7a03128faf8bbbc36021fbf418a31b1a604e29e2 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Tue, 5 Apr 2022 14:02:52 +0200 Subject: MDEV-28205: SST via mariabackup stops on failure while archiving logs Currenly SST script for mariabackup stops on any failure while archiving logs, e.g. when unable to create directory, insufficient permissions, gzip failure, etc. However, in case of such problems, the script should issue a warning and continue without archiving, but not exit with a fatal error. This commit adds this fix to the SST script for mariabackup. --- scripts/wsrep_sst_mariabackup.sh | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh index 067a777fb9c..51de0f1ce2e 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" -- cgit v1.2.1 From 42908dc5fb06039d5e7f08f425d19829dee40c49 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Tue, 12 Apr 2022 13:37:27 +0200 Subject: MDEV-26171: wsrep_sst_receive_address does not parse IPv6 address correctly This commit fixes problems with parsing ipv6 addresses given via the wsrep_sst_receive_address and wsrep_node_address options. Also, this commit removes extra lines in the configuration files in the mtr test suites for Galera related to these parameters. --- scripts/wsrep_sst_mariabackup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh index 51de0f1ce2e..87ed8392475 100644 --- a/scripts/wsrep_sst_mariabackup.sh +++ b/scripts/wsrep_sst_mariabackup.sh @@ -889,12 +889,12 @@ else if ! mkdir -p "$sstlogarchivedir"; then sstlogarchivedir="" wsrep_log_warning \ - "Unable to create '$sstlogarchivedir' directory" + "Unable to create '$sstlogarchivedir' directory" fi elif [ ! -w "$sstlogarchivedir" ]; then sstlogarchivedir="" wsrep_log_warning \ - "The '$sstlogarchivedir' directory is not writtable" + "The '$sstlogarchivedir' directory is not writtable" fi fi @@ -918,7 +918,7 @@ 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 @@ -930,7 +930,7 @@ 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 -- cgit v1.2.1