Skip to content

Commit 3eecb8d

Browse files
committed
MDEV-25356: SST scripts should use the new mariabackup interface
SST scripts for Galera should use the new mariabackup interface instead of the innobackupex interface, which is currently only supported for compatibility reasons. This commit converts the SST script for mariabackup to use the new interface. It does not need separate tests, as any problems will be seen as failures when running multiple tests for the mariabackup-based SST.
1 parent bf1e09e commit 3eecb8d

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

extra/mariabackup/backup_mysql.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA
4444
#include <mysql.h>
4545
#include <mysqld.h>
4646
#include <my_sys.h>
47+
#include <stdlib.h>
4748
#include <string.h>
4849
#include <limits>
4950
#include "common.h"
@@ -107,6 +108,13 @@ xb_mysql_connect()
107108
return(NULL);
108109
}
109110

111+
#if !defined(DONT_USE_MYSQL_PWD)
112+
if (!opt_password)
113+
{
114+
opt_password=getenv("MYSQL_PWD");
115+
}
116+
#endif
117+
110118
if (!opt_secure_auth) {
111119
mysql_options(connection, MYSQL_SECURE_AUTH,
112120
(char *) &opt_secure_auth);

extra/mariabackup/innobackupex.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA
4141

4242
#include <my_global.h>
4343
#include <stdio.h>
44-
#include <stdlib.h>
4544
#include <string.h>
4645
#include <mysql.h>
4746
#include <my_dir.h>
@@ -905,12 +904,6 @@ ibx_init()
905904

906905
opt_user = opt_ibx_user;
907906
opt_password = opt_ibx_password;
908-
#if !defined(DONT_USE_MYSQL_PWD)
909-
if (!opt_password)
910-
{
911-
opt_password=getenv("MYSQL_PWD");
912-
}
913-
#endif
914907
opt_host = opt_ibx_host;
915908
opt_defaults_group = opt_ibx_defaults_group;
916909
opt_socket = opt_ibx_socket;

scripts/wsrep_sst_mariabackup.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -766,9 +766,9 @@ if [[ $ssyslog -eq 1 ]];then
766766
logger -p daemon.info -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE "$@"
767767
}
768768

769-
INNOAPPLY="${INNOBACKUPEX_BIN} --innobackupex $disver $iapts \$INNOEXTRA --apply-log \$rebuildcmd \${DATA} 2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-apply"
770-
INNOMOVE="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $impts --move-back --force-non-empty-directories \${DATA} 2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-move"
771-
INNOBACKUP="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2> >(logger -p daemon.err -t ${ssystag}innobackupex-backup)"
769+
INNOAPPLY="${INNOBACKUPEX_BIN} --prepare $disver $iapts \$INNOEXTRA $rebuildcmd --target-dir=\${DATA} 2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-apply"
770+
INNOMOVE="${INNOBACKUPEX_BIN} ${WSREP_SST_OPT_CONF} --move-back $disver $impts --force-non-empty-directories --target-dir=\${DATA} 2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-move"
771+
INNOBACKUP="${INNOBACKUPEX_BIN} ${WSREP_SST_OPT_CONF} --backup $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt --target-dir=\$itmpdir 2> >(logger -p daemon.err -t ${ssystag}innobackupex-backup)"
772772
fi
773773

774774
else
@@ -830,9 +830,9 @@ then
830830

831831
fi
832832

833-
INNOAPPLY="${INNOBACKUPEX_BIN} --innobackupex $disver $iapts \$INNOEXTRA --apply-log \$rebuildcmd \${DATA} &> ${INNOAPPLYLOG}"
834-
INNOMOVE="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $impts --move-back --force-non-empty-directories \${DATA} &> ${INNOMOVELOG}"
835-
INNOBACKUP="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2> ${INNOBACKUPLOG}"
833+
INNOAPPLY="${INNOBACKUPEX_BIN} --prepare $disver $iapts \$INNOEXTRA $rebuildcmd --target-dir=\${DATA} &> ${INNOAPPLYLOG}"
834+
INNOMOVE="${INNOBACKUPEX_BIN} ${WSREP_SST_OPT_CONF} --move-back $disver $impts --force-non-empty-directories --target-dir=\${DATA} &> ${INNOMOVELOG}"
835+
INNOBACKUP="${INNOBACKUPEX_BIN} ${WSREP_SST_OPT_CONF} --backup $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt --target-dir=\$itmpdir 2> ${INNOBACKUPLOG}"
836836
fi
837837

838838
get_stream
@@ -855,7 +855,7 @@ then
855855
-z $(parse_cnf --mysqld tmpdir "") && \
856856
-z $(parse_cnf xtrabackup tmpdir "") ]]; then
857857
xtmpdir=$(mktemp -d)
858-
tmpopts=" --tmpdir=$xtmpdir"
858+
tmpopts="--tmpdir=$xtmpdir"
859859
wsrep_log_info "Using $xtmpdir as xtrabackup temporary directory"
860860
fi
861861

0 commit comments

Comments
 (0)