diff options
author | Julius Goryavsky <julius.goryavsky@mariadb.com> | 2022-05-06 02:38:36 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2022-05-18 01:22:29 +0200 |
commit | b081ad8c65d3a94210841477cb5f0683ce64a7e3 (patch) | |
tree | 694aac5d5d896f8a2b355326a42f0d06e2aaa938 /scripts | |
parent | 107623c5c57fa81fd2942ba43ac3677f32ae230c (diff) | |
download | mariadb-git-b081ad8c65d3a94210841477cb5f0683ce64a7e3.tar.gz |
MDEV-28423: Galera IST is failing on Joiner node
This commit fixes an issue with IST handling in
version 10.9 which is a regression after MDEV-26971
and related to trying to get a non-existent "total"
tag on the IST branch (this tag is only defined in
SST mode).
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/wsrep_sst_mariabackup.sh | 22 | ||||
-rw-r--r-- | scripts/wsrep_sst_rsync.sh | 33 |
2 files changed, 28 insertions, 27 deletions
diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh index 87ed8392475..314d2349bcc 100644 --- a/scripts/wsrep_sst_mariabackup.sh +++ b/scripts/wsrep_sst_mariabackup.sh @@ -86,6 +86,7 @@ encrypt_threads="" encrypt_chunk="" readonly SECRET_TAG='secret' +readonly TOTAL_TAG='total' # Required for backup locks # For backup locks it is 1 sent by joiner @@ -324,7 +325,8 @@ get_transfer() if [ -z "$ssl_dhparams" ]; then # Determine the socat version SOCAT_VERSION=$(socat -V 2>&1 | \ - grep -m1 -owE '[0-9]+(\.[0-9]+)+' | head -n1) + grep -m1 -owE '[0-9]+(\.[0-9]+)+' | \ + head -n1 || :) if [ -z "$SOCAT_VERSION" ]; then wsrep_log_error "******** FATAL ERROR ******************" wsrep_log_error "* Cannot determine the socat version. *" @@ -770,25 +772,26 @@ recv_joiner() if [ $checkf -eq 1 ]; then if [ ! -r "$MAGIC_FILE" ]; then - # this message should cause joiner to abort + # this message should cause joiner to abort: wsrep_log_error "receiving process ended without creating" \ - "'$MAGIC_FILE'" - wsrep_log_info "Contents of datadir" + "magic file ($MAGIC_FILE)" + wsrep_log_info "Contents of datadir:" wsrep_log_info $(ls -l "$dir/"*) exit 32 fi # check donor supplied secret - SECRET=$(grep -F -- "$SECRET_TAG " "$MAGIC_FILE" 2>/dev/null | \ - cut -d ' ' -f2) + SECRET=$(grep -m1 -E "^$SECRET_TAG[[:space:]]" -- "$MAGIC_FILE" || :) + SECRET=$(trim_string "${SECRET#$SECRET_TAG}") if [ "$SECRET" != "$MY_SECRET" ]; then wsrep_log_error "Donor does not know my secret!" wsrep_log_info "Donor: '$SECRET', my: '$MY_SECRET'" exit 32 fi - # remove secret from the magic file - grep -v -F -- "$SECRET_TAG " "$MAGIC_FILE" > "$MAGIC_FILE.new" + # remove secret and total from the magic file + grep -v -E "^($SECRET_TAG|$TOTAL_TAG)[[:space:]]" -- \ + "$MAGIC_FILE" > "$MAGIC_FILE.new" mv "$MAGIC_FILE.new" "$MAGIC_FILE" fi } @@ -1256,8 +1259,7 @@ then recv_joiner "$STATDIR" "$stagemsg-gtid" $stimeout 1 1 - if ! ps -p "$WSREP_SST_OPT_PARENT" >/dev/null 2>&1 - then + if ! ps -p "$WSREP_SST_OPT_PARENT" >/dev/null 2>&1; then wsrep_log_error "Parent mysqld process (PID: $WSREP_SST_OPT_PARENT)" \ "terminated unexpectedly." exit 32 diff --git a/scripts/wsrep_sst_rsync.sh b/scripts/wsrep_sst_rsync.sh index 29e2b390e27..27d4e875674 100644 --- a/scripts/wsrep_sst_rsync.sh +++ b/scripts/wsrep_sst_rsync.sh @@ -804,8 +804,7 @@ EOF sleep 1 done - if ! ps -p $MYSQLD_PID >/dev/null 2>&1 - then + if ! ps -p $MYSQLD_PID >/dev/null 2>&1; then wsrep_log_error \ "Parent mysqld process (PID: $MYSQLD_PID) terminated unexpectedly." kill -- -$MYSQLD_PID @@ -813,24 +812,24 @@ EOF exit 32 fi - if [ -r "$MAGIC_FILE" ]; then - if [ -n "$MY_SECRET" ]; then - # Check donor supplied secret: - SECRET=$(grep -F -- "$SECRET_TAG " "$MAGIC_FILE" 2>/dev/null | \ - cut -d ' ' -f2) - if [ "$SECRET" != "$MY_SECRET" ]; then - wsrep_log_error "Donor does not know my secret!" - wsrep_log_info "Donor: '$SECRET', my: '$MY_SECRET'" - exit 32 - fi - fi - else + if [ ! -r "$MAGIC_FILE" ]; then # This message should cause joiner to abort: - wsrep_log_info "rsync process ended without creating magic file" - echo "rsync process ended without creating '$MAGIC_FILE'" + wsrep_log_info "rsync process ended without creating" \ + "magic file ($MAGIC_FILE)" exit 32 fi + if [ -n "$MY_SECRET" ]; then + # Check donor supplied secret: + SECRET=$(grep -m1 -E "^$SECRET_TAG[[:space:]]" -- "$MAGIC_FILE" || :) + SECRET=$(trim_string "${SECRET#$SECRET_TAG}") + if [ "$SECRET" != "$MY_SECRET" ]; then + wsrep_log_error "Donor does not know my secret!" + wsrep_log_info "Donor: '$SECRET', my: '$MY_SECRET'" + exit 32 + fi + fi + if [ -n "$WSREP_SST_OPT_BINLOG" ]; then binlog_tar_present=0 [ -f "$BINLOG_TAR_FILE" ] && binlog_tar_present=1 @@ -907,7 +906,7 @@ EOF if [ -n "$MY_SECRET" ]; then # remove secret from the magic file, and output # the UUID:seqno & wsrep_gtid_domain_id: - grep -v -F -- "$SECRET_TAG " "$MAGIC_FILE" + grep -v -E "^$SECRET_TAG[[:space:]]" -- "$MAGIC_FILE" else # Output the UUID:seqno and wsrep_gtid_domain_id: cat "$MAGIC_FILE" |