diff options
author | Krunal Bauskar <krunal.bauskar@percona.com> | 2015-12-04 15:09:08 +0530 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2016-02-23 21:46:53 -0500 |
commit | f67d6fccacfb8a2963f23448cabb67c6178d2a10 (patch) | |
tree | 4137f8261caa6a6c47c3d12ed8bdc2d0633f48f9 /scripts/wsrep_sst_xtrabackup-v2.sh | |
parent | 0cf66e49dbe6a13533769f325a615f357d31df98 (diff) | |
download | mariadb-git-f67d6fccacfb8a2963f23448cabb67c6178d2a10.tar.gz |
- PXC#480: xtrabackup-v2 SST fails with multiple log_bin directives in my.cnf
If any given variable the xtrabackup-v2 sst script looks for is specified
multiple times in cnf file then it tend to pick both of them causing
some of the follow-up command to fail.
Avoid this programatic mistake by honoring only the last variable assigned
setting as done by mysqld too.
Check https://bugs.launchpad.net/percona-xtradb-cluster/+bug/1362830
Diffstat (limited to 'scripts/wsrep_sst_xtrabackup-v2.sh')
-rw-r--r-- | scripts/wsrep_sst_xtrabackup-v2.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/wsrep_sst_xtrabackup-v2.sh b/scripts/wsrep_sst_xtrabackup-v2.sh index 2634fead919..6357d811e44 100644 --- a/scripts/wsrep_sst_xtrabackup-v2.sh +++ b/scripts/wsrep_sst_xtrabackup-v2.sh @@ -240,7 +240,11 @@ parse_cnf() { local group=$1 local var=$2 - reval=$($MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF $group | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2-) + # print the default settings for given group using my_print_default. + # normalize the variable names specified in cnf file (user can use _ or - for example log-bin or log_bin) + # then grep for needed variable + # finally get the variable value (if variables has been specified multiple time use the last value only) + reval=$($MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF $group | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2- | tail -1) if [[ -z $reval ]];then [[ -n $3 ]] && reval=$3 fi |