Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDEV-34856 : Galera Cluster upgrade from 11.0 to 11.1 fails, eventual… #443

Open
wants to merge 1 commit into
base: 11.4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions extra/mariabackup/backup_copy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1808,6 +1808,7 @@ copy_back()
MB_BINLOG_INFO,
MB_METADATA_FILENAME,
XTRABACKUP_BINLOG_INFO,
XTRABACKUP_GALERA_INFO,
XTRABACKUP_METADATA_FILENAME,
".qp", ".pmap", ".tmp",
NULL};
Expand Down
29 changes: 24 additions & 5 deletions scripts/wsrep_sst_mariabackup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ fi
DATA="$WSREP_SST_OPT_DATA"

INFO_FILE='mariadb_backup_galera_info'
INFO_FILE_OLD='xtrabackup_galera_info'
DONOR_INFO_FILE='donor_galera_info'
IST_FILE='xtrabackup_ist'
MAGIC_FILE="$DATA/$INFO_FILE"
Expand Down Expand Up @@ -681,8 +682,8 @@ cleanup_at_exit()

if [ $estatus -ne 0 ]; then
wsrep_log_error "Removing $MAGIC_FILE file due to signal"
[ -f "$MAGIC_FILE" ] && rm -f "$MAGIC_FILE" || :
[ -f "$DONOR_MAGIC_FILE" ] && rm -f "$DONOR_MAGIC_FILE" || :
[ -f "$MAGIC_FILE" ] && rm -rf "$MAGIC_FILE" || :
[ -f "$DONOR_MAGIC_FILE" ] && rm -rf "$DONOR_MAGIC_FILE" || :
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change to use rm -rf here? target file is a simple file not a directory to be removed recursively

fi

if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
Expand Down Expand Up @@ -846,6 +847,14 @@ recv_joiner()
done

if [ $checkf -eq 1 ]; then
if [ ! -r "$MAGIC_FILE" ]; then
if [ -r "$DATA/$INFO_FILE_OLD" ]; then
wsrep_log_info "Backup from old release file ($DATA/$INFO_FILE_OLD)" \
" exists but not ($MAGIC_FILE)"
mv -f "$DATA/$INFO_FILE_OLD" "$MAGIC_FILE"
fi
fi

if [ ! -r "$MAGIC_FILE" ]; then
# this message should cause joiner to abort:
wsrep_log_error "receiving process ended without creating" \
Expand Down Expand Up @@ -919,7 +928,7 @@ monitor_process()
done
}

[ -f "$MAGIC_FILE" ] && rm -f "$MAGIC_FILE"
[ -f "$MAGIC_FILE" ] && rm -rf "$MAGIC_FILE"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also here, using -r flag is not obvious choice

[ -f "$DONOR_MAGIC_FILE" ] && rm -rf "$DONOR_MAGIC_FILE"

read_cnf
Expand Down Expand Up @@ -1337,8 +1346,8 @@ else # joiner
[ -f "$DATA/$IST_FILE" ] && rm -f "$DATA/$IST_FILE"

# May need mariadb_backup_checkpoints later on
[ -f "$DATA/xtrabackup_binary" ] && rm -f "$DATA/xtrabackup_binary"
[ -f "$DATA/mariadb_backup_galera_info" ] && rm -f "$DATA/mariadb_backup_galera_info"
[ -f "$DATA/xtrabackup_binary" ] && rm -rf "$DATA/xtrabackup_binary"
[ -f "$DATA/mariadb_backup_galera_info" ] && rm -rf "$DATA/mariadb_backup_galera_info"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also here -rf flag is used


ADDR="$WSREP_SST_OPT_HOST"

Expand Down Expand Up @@ -1450,9 +1459,19 @@ else # joiner
wsrep_log_info "Waiting for SST streaming to complete!"
monitor_process $jpid

if [ ! -s "$DATA/mariadb_backup_checkpoints" ]; then
if [ -s "$DATA/xtrabackup_checkpoints" ]; then
wsrep_log_info "Backup from old release file ($DATA/xtrabackup_checkpoints)" \
" exists but not ($DATA/mariadb_backup_checkpoints)"
mv -f "$DATA/xtrabackup_checkpoints" "$DATA/mariadb_backup_checkpoints"
fi
fi

if [ ! -s "$DATA/mariadb_backup_checkpoints" ]; then
wsrep_log_error "mariadb_backup_checkpoints missing," \
"failed mariadb-backup/SST on donor"
wsrep_log_info "Contents of datadir:"
wsrep_log_info $(ls -l "$dir/"*)
exit 2
fi

Expand Down