summaryrefslogtreecommitdiff
path: root/scripts/mysqld_multi.sh
diff options
context:
space:
mode:
authorJulius Goryavsky <julius.goryavsky@mariadb.com>2019-07-30 13:45:13 +0200
committerJulius Goryavsky <julius.goryavsky@mariadb.com>2019-08-19 23:43:16 +0200
commit457dc9d64d9f044760adbeca6facc813b754d43b (patch)
treef82a55586afa997c9bdc02654e7e01724a397ee0 /scripts/mysqld_multi.sh
parentf987de7122b8bd72b758cb8e172bec1ff5f7124b (diff)
downloadmariadb-git-457dc9d64d9f044760adbeca6facc813b754d43b.tar.gz
MDEV-18863: Galera SST scripts can't read [mysqldN] option groups
Some users and some scripts (for example, mysqld_multi.sh) use special option groups with names like [mysqld1], [mysqld2], ..., [mysqldN]. But SST scripts can't currently fully support these option groups. The only option group-related value it gets from the server is --defaults-group-suffix, if that option was set for mysqld when the server was started. However, the SST scripts does not get told by the server to read these option groups, so this means that the SST script will fail to read options like innodb-data-home-dir when it is in a option group like [mysqld1]...[mysqldN]. Moreover, SST scripts ignore many parameters that can be passed to them explicitly and cannot transfer them further, for example, to the input of mariabackup utility. Ideally, we want to transfer all the parameters of the original mysqld call to utilities such as mariabackup, however the SST script does not receive these parameters from the server and therefore cannot transfer them to mariabackup. To correct these shortcomings, we need to transfer to the scripts all of the parameters of the original mysqld call, and in the SST scripts themselves provide for the transfer all of these parameters to utilities such as mariabackup. To prevent these parameters from mixing with the script's own parameters, they should be transferred to SST script after the special option "--mysqld-args", followed by the string argument with the original parameters, as it received by the mysqld call at the time of launch (further all these parameters will be passed to mariabackup, for example). In addition, the SST scripts themselves must be refined so that they can read the parameters from the user-selected group, not just from the global mysqld configuration group. And also so that they can receive the parameters (which important for their work) as command-line arguments.
Diffstat (limited to 'scripts/mysqld_multi.sh')
-rw-r--r--scripts/mysqld_multi.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh
index 64fa76f0e97..0bd50c1974f 100644
--- a/scripts/mysqld_multi.sh
+++ b/scripts/mysqld_multi.sh
@@ -308,7 +308,9 @@ sub report_mysqlds
sub start_mysqlds()
{
- my (@groups, $com, $tmp, $i, @options, $j, $mysqld_found, $info_sent);
+ my (@groups, $com, $tmp, $i, @options, $j, $mysqld_found, $suffix_found, $info_sent);
+
+ $suffix_found= 0;
if (!$opt_no_log)
{
@@ -347,6 +349,10 @@ sub start_mysqlds()
$options[$j]= quote_shell_word($options[$j]);
$tmp.= " $options[$j]";
}
+ elseif ("--defaults-group-suffix=" eq substr($options[$j], 0, 24))
+ {
+ $suffix_found= 1;
+ }
else
{
$options[$j]= quote_shell_word($options[$j]);
@@ -364,6 +370,12 @@ sub start_mysqlds()
}
$com.= $tmp;
+ if (!$suffix_found)
+ {
+ $com.= " --defaults-group-suffix=";
+ $com.= $groups[$i];
+ }
+
if ($opt_wsrep_new_cluster) {
$com.= " --wsrep-new-cluster";
}