Skip to content

Commit

Permalink
MDEV-21526: mysqld_multi no longer works with different server binaries
Browse files Browse the repository at this point in the history
The problem is caused by the fact that adding the
--defaults-group-suffix option to fix MDEV-18863 causes
mysqld to read all options from the appropriate sections
of the config file, including options specific to mysqld_multi.
Reading unknown options (which are not supported by mysqld)
causes mysqld to terminate with an error.

However, the MDEV-18863 problem has been completely fixed
by passing options on the command line, and now there is no
need to specify the --defaults-group-suffix option (we just
need to give priority to options passed through the command
line, so as not to break MDEV-18863).
  • Loading branch information
sysprg committed Aug 11, 2020
1 parent caf1059 commit 7ad4709
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
14 changes: 1 addition & 13 deletions scripts/mysqld_multi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,7 @@ sub report_mysqlds

sub start_mysqlds()
{
my (@groups, $com, $tmp, $i, @options, $j, $mysqld_found, $suffix_found, $info_sent);

$suffix_found= 0;
my (@groups, $com, $tmp, $i, @options, $j, $mysqld_found, $info_sent);

if (!$opt_no_log)
{
Expand Down Expand Up @@ -349,10 +347,6 @@ sub start_mysqlds()
$options[$j]= quote_shell_word($options[$j]);
$tmp.= " $options[$j]";
}
elsif ("--defaults-group-suffix=" eq substr($options[$j], 0, 24))
{
$suffix_found= 1;
}
else
{
$options[$j]= quote_shell_word($options[$j]);
Expand All @@ -369,12 +363,6 @@ sub start_mysqlds()
$info_sent= 1;
}

if (!$suffix_found)
{
$com.= " --defaults-group-suffix=";
$com.= substr($groups[$i],6);
}

$com.= $tmp;

if ($opt_wsrep_new_cluster) {
Expand Down
25 changes: 17 additions & 8 deletions scripts/wsrep_sst_mariabackup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,8 @@ INNODB_DATA_HOME_DIR=${INNODB_DATA_HOME_DIR:-""}
if [ ! -z "$INNODB_DATA_HOME_DIR_ARG" ]; then
INNODB_DATA_HOME_DIR=$INNODB_DATA_HOME_DIR_ARG
fi
# if INNODB_DATA_HOME_DIR env. variable is not set, try to get it from my.cnf
# if no command line arg and INNODB_DATA_HOME_DIR environment variable
# is not set, try to get it from my.cnf:
if [ -z "$INNODB_DATA_HOME_DIR" ]; then
INNODB_DATA_HOME_DIR=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-data-home-dir '')
fi
Expand Down Expand Up @@ -961,17 +962,25 @@ then

ib_home_dir=$INNODB_DATA_HOME_DIR

# Try to set ib_log_dir from the command line:
ib_log_dir=$INNODB_LOG_GROUP_HOME_ARG
if [ -z "$ib_log_dir" ]; then
ib_log_dir=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-log-group-home-dir "")
WSREP_LOG_DIR=${WSREP_LOG_DIR:-""}
# Try to set WSREP_LOG_DIR from the command line:
if [ ! -z "$INNODB_LOG_GROUP_HOME_ARG" ]; then
WSREP_LOG_DIR=$INNODB_LOG_GROUP_HOME_ARG
fi
if [ -z "$ib_log_dir" ]; then
ib_log_dir=$(parse_cnf --mysqld innodb-log-group-home-dir "")
# if no command line arg and WSREP_LOG_DIR is not set,
# try to get it from my.cnf:
if [ -z "$WSREP_LOG_DIR" ]; then
WSREP_LOG_DIR=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-log-group-home-dir '')
fi
if [ -z "$WSREP_LOG_DIR" ]; then
WSREP_LOG_DIR=$(parse_cnf --mysqld innodb-log-group-home-dir '')
fi

ib_log_dir=$WSREP_LOG_DIR

# Try to set ib_undo_dir from the command line:
ib_undo_dir=$INNODB_UNDO_DIR_ARG
ib_undo_dir=${INNODB_UNDO_DIR_ARG:-""}
# if no command line arg then try to get it from my.cnf:
if [ -z "$ib_undo_dir" ]; then
ib_undo_dir=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-undo-directory "")
fi
Expand Down
8 changes: 5 additions & 3 deletions scripts/wsrep_sst_rsync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,11 @@ fi

WSREP_LOG_DIR=${WSREP_LOG_DIR:-""}
# Try to set WSREP_LOG_DIR from the command line:
if [ -z "$WSREP_LOG_DIR" ]; then
if [ ! -z "$INNODB_LOG_GROUP_HOME_ARG" ]; then
WSREP_LOG_DIR=$INNODB_LOG_GROUP_HOME_ARG
fi
# if WSREP_LOG_DIR env. variable is not set, try to get it from my.cnf
# if no command line arg and WSREP_LOG_DIR is not set,
# try to get it from my.cnf:
if [ -z "$WSREP_LOG_DIR" ]; then
WSREP_LOG_DIR=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-log-group-home-dir '')
fi
Expand All @@ -136,7 +137,8 @@ INNODB_DATA_HOME_DIR=${INNODB_DATA_HOME_DIR:-""}
if [ ! -z "$INNODB_DATA_HOME_DIR_ARG" ]; then
INNODB_DATA_HOME_DIR=$INNODB_DATA_HOME_DIR_ARG
fi
# if INNODB_DATA_HOME_DIR env. variable is not set, try to get it from my.cnf
# if no command line arg and INNODB_DATA_HOME_DIR environment variable
# is not set, try to get it from my.cnf:
if [ -z "$INNODB_DATA_HOME_DIR" ]; then
INNODB_DATA_HOME_DIR=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-data-home-dir '')
fi
Expand Down
3 changes: 2 additions & 1 deletion scripts/wsrep_sst_xtrabackup-v2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,8 @@ INNODB_DATA_HOME_DIR=${INNODB_DATA_HOME_DIR:-""}
if [ ! -z "$INNODB_DATA_HOME_DIR_ARG" ]; then
INNODB_DATA_HOME_DIR=$INNODB_DATA_HOME_DIR_ARG
fi
# if INNODB_DATA_HOME_DIR env. variable is not set, try to get it from my.cnf
# if no command line arg and INNODB_DATA_HOME_DIR environment variable
# is not set, try to get it from my.cnf:
if [ -z "$INNODB_DATA_HOME_DIR" ]; then
INNODB_DATA_HOME_DIR=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-data-home-dir '')
fi
Expand Down

0 comments on commit 7ad4709

Please sign in to comment.