Commit 7d550c76 authored by Philip Stoev's avatar Philip Stoev Committed by Nirbhay Choubey

LP1378355 - Pass the value of --defaults-group-suffix to xtrabackup during SST

parent 9d15689d
......@@ -89,10 +89,13 @@ static char my_defaults_extra_file_buffer[FN_REFLEN];
static my_bool defaults_already_read= FALSE;
#ifdef WITH_WSREP
/* The only purpose of this global array is to hold full name of my.cnf
* which seems to be otherwise unavailable */
char wsrep_defaults_file[FN_REFLEN + 10]={0,};
#endif /* WITH_WREP */
/*
The only purpose of this global array is to hold full name of my.cnf
which seems to be otherwise unavailable.
*/
char wsrep_defaults_file[FN_REFLEN + 10]= {0,};
char wsrep_defaults_group_suffix[FN_REFLEN]= {0,};
#endif /* WITH_WSREP */
/* Which directories are searched for options (and in which order) */
......@@ -439,6 +442,16 @@ int get_defaults_options(int argc, char **argv,
if (!*group_suffix && is_prefix(*argv, "--defaults-group-suffix="))
{
*group_suffix= *argv + sizeof("--defaults-group-suffix=")-1;
#ifdef WITH_WSREP
/* make sure we do this only once - for top-level file */
if ('\0' == wsrep_defaults_group_suffix[0])
{
strncpy(wsrep_defaults_group_suffix, *group_suffix,
sizeof(wsrep_defaults_group_suffix) - 1);
}
#endif /* WITH_WSREP */
argc--;
continue;
}
......
......@@ -44,6 +44,10 @@ case "$1" in
readonly WSREP_SST_OPT_CONF="$2"
shift
;;
'--defaults-group-suffix')
readonly WSREP_SST_OPT_CONF_SUFFIX="$2"
shift
;;
'--host')
readonly WSREP_SST_OPT_HOST="$2"
shift
......
......@@ -557,8 +557,8 @@ fi
INNOEXTRA=""
INNOAPPLY="${INNOBACKUPEX_BIN} $disver $iapts --apply-log \$rebuildcmd \${DATA} &>\${DATA}/innobackup.prepare.log"
INNOMOVE="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} $disver $impts --move-back --force-non-empty-directories \${DATA} &>\${DATA}/innobackup.move.log"
INNOBACKUP="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2>\${DATA}/innobackup.backup.log"
INNOMOVE="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} --defaults-group=mysqld${WSREP_SST_OPT_CONF_SUFFIX} $disver $impts --move-back --force-non-empty-directories \${DATA} &>\${DATA}/innobackup.move.log"
INNOBACKUP="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} --defaults-group=mysqld${WSREP_SST_OPT_CONF_SUFFIX} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2>\${DATA}/innobackup.backup.log"
if [ "$WSREP_SST_OPT_ROLE" = "donor" ]
then
......@@ -879,7 +879,7 @@ then
if [[ $incremental -eq 1 ]];then
# Added --ibbackup=xtrabackup_55 because it fails otherwise citing connection issues.
INNOAPPLY="${INNOBACKUPEX_BIN} $disver --defaults-file=${WSREP_SST_OPT_CONF} \
INNOAPPLY="${INNOBACKUPEX_BIN} $disver --defaults-file=${WSREP_SST_OPT_CONF} --defaults-group=mysqld${WSREP_SST_OPT_CONF_SUFFIX} \
--ibbackup=xtrabackup_56 --apply-log $rebuildcmd --redo-only $BDATA --incremental-dir=${DATA} &>>${BDATA}/innobackup.prepare.log"
fi
......
......@@ -30,6 +30,7 @@
#include <cstdlib>
extern const char wsrep_defaults_file[];
extern const char wsrep_defaults_group_suffix[];
const char* wsrep_sst_method = WSREP_SST_DEFAULT;
const char* wsrep_sst_receive_address = WSREP_SST_ADDRESS_AUTO;
......@@ -462,11 +463,12 @@ static ssize_t sst_prepare_other (const char* method,
WSREP_SST_OPT_AUTH" '%s' "
WSREP_SST_OPT_DATA" '%s' "
WSREP_SST_OPT_CONF" '%s' "
WSREP_SST_OPT_CONF_SUFFIX" '%s' "
WSREP_SST_OPT_PARENT" '%d'"
" %s '%s' ",
method, addr_in, (sst_auth_real) ? sst_auth_real : "",
sst_dir, wsrep_defaults_file, (int)getpid(),
binlog_opt, binlog_opt_val);
sst_dir, wsrep_defaults_file, wsrep_defaults_group_suffix,
(int) getpid(), binlog_opt, binlog_opt_val);
my_free(binlog_opt_val);
if (ret < 0 || ret >= (int)sizeof(cmd_str))
......@@ -761,10 +763,11 @@ static int sst_donate_mysqldump (const char* addr,
WSREP_SST_OPT_LPORT" '%u' "
WSREP_SST_OPT_SOCKET" '%s' "
WSREP_SST_OPT_CONF" '%s' "
WSREP_SST_OPT_CONF_SUFFIX" '%s' "
WSREP_SST_OPT_GTID" '%s:%lld'"
"%s",
user, pswd, host, port, mysqld_port, mysqld_unix_port,
wsrep_defaults_file, uuid_str,
wsrep_defaults_file, wsrep_defaults_group_suffix, uuid_str,
(long long)seqno, bypass ? " "WSREP_SST_OPT_BYPASS : "");
WSREP_DEBUG("Running: '%s'", cmd_str);
......@@ -1034,12 +1037,13 @@ static int sst_donate_other (const char* method,
WSREP_SST_OPT_SOCKET" '%s' "
WSREP_SST_OPT_DATA" '%s' "
WSREP_SST_OPT_CONF" '%s' "
WSREP_SST_OPT_CONF_SUFFIX" '%s' "
" %s '%s' "
WSREP_SST_OPT_GTID" '%s:%lld'"
"%s",
method, addr, sst_auth_real, mysqld_unix_port,
mysql_real_data_home, wsrep_defaults_file,
binlog_opt, binlog_opt_val,
wsrep_defaults_group_suffix, binlog_opt, binlog_opt_val,
uuid, (long long) seqno,
bypass ? " "WSREP_SST_OPT_BYPASS : "");
my_free(binlog_opt_val);
......
......@@ -24,6 +24,7 @@
#define WSREP_SST_OPT_AUTH "--auth"
#define WSREP_SST_OPT_DATA "--datadir"
#define WSREP_SST_OPT_CONF "--defaults-file"
#define WSREP_SST_OPT_CONF_SUFFIX "--defaults-group-suffix"
#define WSREP_SST_OPT_PARENT "--parent"
#define WSREP_SST_OPT_BINLOG "--binlog"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment