summaryrefslogtreecommitdiff
path: root/scripts/wsrep_sst_common.sh
Commit message (Collapse)AuthorAgeFilesLines
* Sourced script should be 644 not 755Faustin Lammler2019-12-021-0/+0
| | | | | | | The script is intented to be sourced by other SST script so it should not be executable (or should have a script header). This is causing a warning on Debian Lintian tool, see: https://salsa.debian.org/faust-guest/mariadb-10.3/-/jobs/431900
* Merge 10.2 into 10.3Marko Mäkelä2019-08-291-3/+15
|\
| * Merge 10.1 into 10.2Marko Mäkelä2019-08-281-3/+15
| |\
| | * MDEV-20420: SST failed after MDEV-18863 in some test configurationsJulius Goryavsky2019-08-261-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After applying MDEV-18863, in some test configurations, SST may fails due to duplication of some parameters (in particular "--port") in the main part of the command line and after "--mysqld-args", as well as due to incorrect interpretation of the parameter "--port" passed after "--mysqld-args" when the SST script is invoked without explicitly specifying a port for SST. In addition, it is necessary to correctly handle spaces, quotation marks and special characters when copying original arguments from the argv[] array to a new command line (after "--mysqld-args"). This patch resolves these shortcomings.
| | * Bash-specific operator replaced by a universal oneJulius Goryavsky2019-08-211-1/+1
| | |
| | * MDEV-18863: Galera SST scripts can't read [mysqldN] option groupsJulius Goryavsky2019-08-191-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | MDEV-18863: Galera SST scripts can't read [mysqldN] option groupsJulius Goryavsky2019-08-191-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | MDEV-18863: Galera SST scripts can't read [mysqldN] option groupsJulius Goryavsky2019-08-191-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge 10.2 into 10.3Marko Mäkelä2019-05-141-1/+1
|\ \ \ | |/ /
| * | Merge 10.1 into 10.2Marko Mäkelä2019-05-131-1/+1
| |\ \ | | |/
| | * Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
| | |
* | | Merge 10.2 into 10.3Marko Mäkelä2019-03-111-2/+0
|\ \ \ | |/ /
| * | Merge 10.1 into 10.2Marko Mäkelä2019-03-111-2/+0
| |\ \ | | |/
| | * wsrep_sst: remove WSREP_SST_OPT_SUFFIX_VALUE, checking [mysqld] is covered ↵Daniel Black2019-03-091-2/+0
| | | | | | | | | | | | in the parse_cnf --mysqld case
| * | Merge 10.1 into 10.2Marko Mäkelä2019-02-021-2/+4
| |\ \ | | |/
| | * MDEV-18379: Unification of check for IPv6Julius Goryavsky2019-01-261-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch contains the port of the MDEV-18379 patch for 10.1 branch, but also includes a number of changes made within MDEV-17835, which are necessary for the normal operation of tests that use IPv6: 1) Fixed flaws in the galera_3nodes mtr suite control scripts, because of which they could not work with mariabackup. 2) Fixed numerous bugs in the SST scripts and in the mtr test files (galera_3nodes mtr suite) that prevented the use of Galera with IPv6 addresses. 3) Fixed flaws in tests for rsync and mysqldump (for galera_3nodes mtr tests suite). These tests were not performed successfully without these fixes. 4) Currently, the three-node mtr suite for Galera (galera_3nodes) uses a separate IPv6 availability check using the "have_ipv6.inc" file. This check duplicates a more accurate check at suite.pm level, which can be used by including the file "check_ipv6.inc". This patch removes this discrepancy between suites. 5) GAL-501 test in the galera_3nodes suite does not contain the option "--bind-address=::" which is needed for the test to work correctly with IPv6 (at least on some systems), since without it the server will not wait for connections on the IPv6 interface. https://jira.mariadb.org/browse/MDEV-18379 and partially https://jira.mariadb.org/browse/MDEV-17835
* | | MDEV-17835: Remove wsrep-sst-method=xtrabackupJulius Goryavsky2019-01-221-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The second line of changes related to replacing xtrabackup with mariabackup: 1) All unnecessary references to xtrabackup are removed from the documentation, from some comments, from the control files that are used to prepare the packages. 2) Made corrections of the tests from the galera_3nodes suite that mentioned xtrabackup or the old (associated with xtrabackup) version of innobackupex. 3) Fixed flaws in the galera_3nodes mtr suite control scripts, because of which they could not work with mariabackup. 4) Fixed numerous bugs in the SST scripts and in the mtr test files (galera_3nodes mtr suite) that prevented the use of Galera with IPv6 addresses. 5) Fixed flaws in tests for rsync and mysqldump (for galera_3nodes mtr tests suite). These tests were not performed successfully without these fixes. https://jira.mariadb.org/browse/MDEV-17835
* | | Merge branch '10.2' into 10.3Sergei Golubchik2018-09-281-3/+23
|\ \ \ | |/ /
| * | Merge branch '10.1' into 10.2Sergei Golubchik2018-09-241-3/+12
| |\ \ | | |/
| | * MDEV-17173: correct parsing of 12.13.14.15:4444/xtrabackup_sst leaving ↵Daniel Black2018-09-131-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LSN/SST_VER blank Correcting commit e78e308e818 $ . scripts/wsrep_sst_common.sh --address 12.13.14.15:4444/xtrabackup_sst ; set | grep WSREP_SST WSREP_SST_OPT_ADDR=12.13.14.15:4444/xtrabackup_sst WSREP_SST_OPT_ADDR_PORT=4444 WSREP_SST_OPT_AUTH= WSREP_SST_OPT_BINLOG= WSREP_SST_OPT_BINLOG_INDEX= WSREP_SST_OPT_BYPASS=0 WSREP_SST_OPT_CONF=' ' WSREP_SST_OPT_DATA= WSREP_SST_OPT_DEFAULT= WSREP_SST_OPT_EXTRA_DEFAULT= WSREP_SST_OPT_HOST=12.13.14.15 WSREP_SST_OPT_HOST_UNESCAPED=12.13.14.15 WSREP_SST_OPT_LSN= WSREP_SST_OPT_MODULE=xtrabackup_sst WSREP_SST_OPT_PATH=xtrabackup_sst WSREP_SST_OPT_PORT=4444 WSREP_SST_OPT_PSWD= WSREP_SST_OPT_SST_VER= WSREP_SST_OPT_SUFFIX_DEFAULT= WSREP_SST_OPT_SUFFIX_VALUE= WSREP_SST_OPT_USER= . scripts/wsrep_sst_common.sh --address 12.13.14.15:4444/xtrabackup_sst/1234/5676 ; set | grep WSREP_SST WSREP_SST_OPT_ADDR=12.13.14.15:4444/xtrabackup_sst/1234/5676 WSREP_SST_OPT_ADDR_PORT=4444 WSREP_SST_OPT_AUTH= WSREP_SST_OPT_BINLOG= WSREP_SST_OPT_BINLOG_INDEX= WSREP_SST_OPT_BYPASS=0 WSREP_SST_OPT_CONF=' ' WSREP_SST_OPT_DATA= WSREP_SST_OPT_DEFAULT= WSREP_SST_OPT_EXTRA_DEFAULT= WSREP_SST_OPT_HOST=12.13.14.15 WSREP_SST_OPT_HOST_UNESCAPED=12.13.14.15 WSREP_SST_OPT_LSN=1234 WSREP_SST_OPT_MODULE=xtrabackup_sst WSREP_SST_OPT_PATH=xtrabackup_sst/1234/5676 WSREP_SST_OPT_PORT=4444 WSREP_SST_OPT_PSWD= WSREP_SST_OPT_SST_VER=5676 WSREP_SST_OPT_SUFFIX_DEFAULT= WSREP_SST_OPT_SUFFIX_VALUE= WSREP_SST_OPT_USER=
| * | Merge branch '10.1' into 10.2Oleksandr Byelkin2018-09-141-0/+11
| |\ \ | | |/
| | * Merge pull request #855 from tempesta-tech/sysprg/10.1-MDEV-10756Jan Lindström2018-09-061-0/+5
| | |\ | | | | | | | | MDEV-10756: wsrep_sst_xtrabackup-v2 does not support innodb_data_home_dir
| | | * MDEV-10756: wsrep_sst_xtrabackup-v2 does not support innodb_data_home_dirJulius Goryavsky2018-08-271-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current versions of xtrabackup-v2 and mariabackup support the option --innodb-data-home-dir, but this parameter is not passed to them from the SST script, since the SST script does not receive this information from mysqld. The transfer of this information to the SST is already fixed by the MDEV-10754 patch, but we need to process it in the SST script. Also, we should take into account that on the joiner side the corresponding information is not read yet from the configuration file (at the mysqld side) during the start of SST, so the script must itself read it. https://jira.mariadb.org/browse/MDEV-10756
| | * | MDEV-15436: If log_bin and log_bin_index is different SST with rsync fails.Jan Lindström2018-09-051-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem was that in SST log_bin_index name and directory was not handled and passed to rsync SST script. wsrep_sst_common.sh Read binlog index dirname and filename if --binlog-index parameter is provided. Read binlog filenames from that file from donor and write transfered binlog filenames to that file in joiner. mysqld.cc, mysqld.h Moved opt_binlog_index_name from static to global and added it to extern. wsrep_sst.cc generate_binlog_index_opt_val New function to generate binlog index name if opt_binlog_index_name is given on configuration. sst_prepare_other Add binlog index configuration to SST command. wsrep_sst.h Add new SST parameter --binlog-index Add test case.
* | | | Merge 10.2 into 10.3Marko Mäkelä2018-09-061-2/+4
|\ \ \ \ | |/ / /
| * | | Merge 10.1 into 10.2Marko Mäkelä2018-08-311-2/+4
| |\ \ \ | | |/ /
| | * | MDEV-15512 - Fix sh parse error when [sst] config value has spaces.Jan Lindström2018-08-291-2/+2
| | |/ | | | | | | | | | | | | Merged https://github.com/MariaDB/server/pull/617 authored by Colin Mollenhour.
| | * Fixes after review and correction of the problems caused by the fact that ↵Julius Goryavsky2018-08-091-0/+2
| | | | | | | | | | | | during the SST innodb plugin is not yet initialized, as well as problems with running tests from the root user (not directly related to the MDEV-10754).
* | | Merge branch '10.2' into 10.3Sergei Golubchik2018-06-301-8/+20
|\ \ \ | |/ /
| * | Merge branch '10.1' into 10.2Sergei Golubchik2018-06-211-8/+20
| |\ \ | | |/
| | * fix galera sst testsSergei Golubchik2018-06-141-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | note that ${A#foo} is $A if there's no prefix foo. That's why galera nodes tried to connect to 127.0.0.1:127.0.0.1 if there was no port in the address Followup for 2b35db5ac4e
| | * Merge branch '10.0-galera' into 10.1Vicențiu Ciorbaru2018-06-121-14/+21
| | |\
| | | * MDEV-13968: wsrep_log_error not defined until later in wsrep_sst_commonDaniel Black2018-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix for 990c4318a779645ee dash -vx './wsrep_sst_common.sh' --address '128.0.0.5:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2' --port 1111 2>&1 | more .... + readonly WSREP_SST_OPT_ADDR=128.0.0.5:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_HOST=128.0.0.5 + readonly WSREP_SST_OPT_HOST_UNESCAPED=128.0.0.5 + remain=3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_ADDR_PORT=3333 + remain=module/lsn_version/sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_MODULE=module + readonly WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2 + remain=lsn_version/sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_LSN=lsn_version + remain=sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_SST_VER=sst_ver + shift + shift + [ 2 -gt 0 ] + readonly WSREP_SST_OPT_PORT=1111 + shift + shift + [ 0 -gt 0 ] readonly WSREP_SST_OPT_BYPASS + readonly WSREP_SST_OPT_BYPASS readonly WSREP_SST_OPT_BINLOG + readonly WSREP_SST_OPT_BINLOG if [ -n "${WSREP_SST_OPT_ADDR_PORT:-}" ]; then if [ -n "${WSREP_SST_OPT_PORT:-}" ]; then if [ "$WSREP_SST_OPT_PORT" != "$WSREP_SST_OPT_ADDR_PORT" ]; then echo "WSREP_SST: [ERROR] port in --port=$WSREP_SST_OPT_PORT differs from port in --address=$WSREP_SST_OPT_ADDR" >&2 exit 2 fi else readonly WSREP_SST_OPT_PORT="$WSREP_SST_OPT_ADDR_PORT" fi fi + [ -n 3333 ] + [ -n 1111 ] + [ 1111 != 3333 ] + echo WSREP_SST: [ERROR] port in --port=1111 differs from port in --address=128.0.0.5:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2 WSREP_SST: [ERROR] port in --port=1111 differs from port in --address=128.0.0.5:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2 + exit 2 dash -vx './wsrep_sst_common.sh' --address '128.0.0.5:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2' 2>&1 | more ... + [ 2 -gt 0 ] + readonly WSREP_SST_OPT_ADDR=128.0.0.5:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_HOST=128.0.0.5 + readonly WSREP_SST_OPT_HOST_UNESCAPED=128.0.0.5 + remain=3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_ADDR_PORT=3333 + remain=module/lsn_version/sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_MODULE=module + readonly WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2 + remain=lsn_version/sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_LSN=lsn_version + remain=sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_SST_VER=sst_ver + shift + shift + [ 0 -gt 0 ] readonly WSREP_SST_OPT_BYPASS + readonly WSREP_SST_OPT_BYPASS readonly WSREP_SST_OPT_BINLOG + readonly WSREP_SST_OPT_BINLOG if [ -n "${WSREP_SST_OPT_ADDR_PORT:-}" ]; then if [ -n "${WSREP_SST_OPT_PORT:-}" ]; then if [ "$WSREP_SST_OPT_PORT" != "$WSREP_SST_OPT_ADDR_PORT" ]; then echo "WSREP_SST: [ERROR] port in --port=$WSREP_SST_OPT_PORT differs from port in --address=$WSREP_SST_OPT_ADDR" >&2 exit 2 fi else readonly WSREP_SST_OPT_PORT="$WSREP_SST_OPT_ADDR_PORT" fi fi + [ -n 3333 ] + [ -n ] + readonly WSREP_SST_OPT_PORT=3333
| | | * MDEV-13968 sst fails with "WSREP_SST_OPT_PORT: readonly variable"Sergei Golubchik2018-05-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | followup for 990c4318a779645ee fix broken script (set -u)
| | | * MDEV-13968 sst fails with "WSREP_SST_OPT_PORT: readonly variable"Sergei Golubchik2018-05-141-0/+11
| | | |
| | | * MDEV-15541: wsrep_sst_common - WSREP_SST_OPT_PORT set twice (--address and ↵Daniel Black2018-05-141-1/+1
| | | | | | | | | | | | | | | | --port)
| | | * MDEV-15496: wsrep_sst_common - parse IPv6 correctDaniel Black2018-05-141-11/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix to e78e308e818a4a763ebb981302851f58f4c42bba, IPv6 got split at : Also got rid of awk (yuck!) to parse port (commit: b4fbb4183b35f921efe079a312b0c1be87866b40) Tested with dash to avoid bashisms: $ dash -vx './wsrep_sst_common.sh' --address '128.0.0.5:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2' 2>&1 | more + readonly WSREP_SST_OPT_ADDR=128.0.0.5:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_HOST=128.0.0.5 + readonly WSREP_SST_OPT_HOST_UNESCAPED=128.0.0.5 + remain=3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_PORT=3333 + remain=module/lsn_version/sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_MODULE=module + readonly WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2 + remain=lsn_version/sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_LSN=lsn_version + remain=sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_SST_VER=sst_ver $ dash -vx './wsrep_sst_common.sh' --address '[2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2' 2>&1 | more + readonly WSREP_SST_OPT_ADDR=[2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2 + addr_no_bracket=2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_HOST_UNESCAPED=2001:db8::1 + readonly WSREP_SST_OPT_HOST=[2001:db8::1] + remain=:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2 + remain=3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_PORT=3333 + remain=module/lsn_version/sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_MODULE=module + readonly WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2 + remain=lsn_version/sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_LSN=lsn_version + remain=sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_SST_VER=sst_ver And bash as well: $ bash -vx './wsrep_sst_common.sh' --address '127.0.0.3:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2' 2>&1 | more + readonly WSREP_SST_OPT_ADDR=127.0.0.3:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2 + WSREP_SST_OPT_ADDR=127.0.0.3:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2 + case "${WSREP_SST_OPT_ADDR}" in + readonly WSREP_SST_OPT_HOST=127.0.0.3 + WSREP_SST_OPT_HOST=127.0.0.3 + readonly WSREP_SST_OPT_HOST_UNESCAPED=127.0.0.3 + WSREP_SST_OPT_HOST_UNESCAPED=127.0.0.3 + remain=3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_PORT=3333 + WSREP_SST_OPT_PORT=3333 + remain=module/lsn_version/sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_MODULE=module + WSREP_SST_OPT_MODULE=module + readonly WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2 + WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2 + remain=lsn_version/sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_LSN=lsn_version + WSREP_SST_OPT_LSN=lsn_version + remain=sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_SST_VER=sst_ver + WSREP_SST_OPT_SST_VER=sst_ver $ bash -vx './wsrep_sst_common.sh' --address '[2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2' 2>&1 | more + readonly 'WSREP_SST_OPT_ADDR=[2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2' + WSREP_SST_OPT_ADDR='[2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2' + case "${WSREP_SST_OPT_ADDR}" in + addr_no_bracket='2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2' + readonly WSREP_SST_OPT_HOST_UNESCAPED=2001:db8::1 + WSREP_SST_OPT_HOST_UNESCAPED=2001:db8::1 + readonly 'WSREP_SST_OPT_HOST=[2001:db8::1]' + WSREP_SST_OPT_HOST='[2001:db8::1]' + remain=:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2 + remain=3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_PORT=3333 + WSREP_SST_OPT_PORT=3333 + remain=module/lsn_version/sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_MODULE=module + WSREP_SST_OPT_MODULE=module + readonly WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2 + WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2 + remain=lsn_version/sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_LSN=lsn_version + WSREP_SST_OPT_LSN=lsn_version + remain=sst_ver/some_future_option1/some_future_option2 + readonly WSREP_SST_OPT_SST_VER=sst_ver + WSREP_SST_OPT_SST_VER=sst_ver
| | * | followup for 89b0d5cb6e3, backport 8c422bf48d7Sergei Golubchik2018-03-231-2/+2
| | | |
| | * | MDEV-13968 sst fails with "WSREP_SST_OPT_PORT: readonly variable"Sergei Golubchik2018-03-231-1/+12
| | | | | | | | | | | | | | | | Backport from 10.2: 4c2c057d404 and f7090df712d
* | | | Revert pull request #640 from ↵Jan Lindström2018-03-171-22/+0
| | | | | | | | | | | | | | | | grooverdan/10.3-MDEV-8743-wsrep_sst_common-close-fds
* | | | MDEV-8743: wsrep_sst_common close FDs > 2Daniel Black2018-03-081-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To prevent accidential overwriting of files due to mysqld file descriptors being open we ensure where that only FDs 1, 2 and 3 are available to SST scripts. Assumed is mysqld has thse still mapped to stdin (unused), stdout and stderr.
* | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2018-02-151-33/+19
|\ \ \ \
| * \ \ \ Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2018-02-081-33/+19
| |\ \ \ \ | | |/ / /
| | * | | remove bash-ish from SST scriptsSergei Golubchik2018-02-061-7/+1
| | | | | | | | | | | | | | | | | | | | replace with awk (yuck!), avoiding gensub (which wasn't recognized)
| | * | | Merge branch 'github/10.1' into 10.2Sergei Golubchik2018-02-061-29/+21
| | |\ \ \ | | | |/ /
| | | * | Merge branch 'github/10.0-galera' into 10.1Sergei Golubchik2018-02-031-29/+21
| | | |\ \ | | | | |/
| | | | * wsrep_sst_common: keep WSREP_SST_OPT_HOST_UNESCAPED for IPv4Daniel Black2018-01-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | change wsrep_sst_mysqldump.sh to use WSREP_SST_OPT_HOST_UNESCAPED directly.
| | | | * wsrep_sst_common: parse --address and split WSREP_SST_OPT_PATHDaniel Black2018-01-141-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the string functionality of sh to split the address: IPv6 test: . scripts/wsrep_sst_common.sh --address [ipv6]:port/module/lsn_version/sst_ver/some_future_option1/some_future_option2 $ set | grep WSREP_SST WSREP_SST_OPT_ADDR='[ipv6]:port/module/lsn_version/sst_ver/some_future_option1/some_future_option2' WSREP_SST_OPT_AUTH= WSREP_SST_OPT_BINLOG= WSREP_SST_OPT_BYPASS=0 WSREP_SST_OPT_CONF=' ' WSREP_SST_OPT_DATA= WSREP_SST_OPT_DEFAULT= WSREP_SST_OPT_EXTRA_DEFAULT= WSREP_SST_OPT_HOST='[ipv6]' WSREP_SST_OPT_HOST_UNESCAPED=ipv6 WSREP_SST_OPT_LSN=lsn_version WSREP_SST_OPT_MODULE=module WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2 WSREP_SST_OPT_PORT=port WSREP_SST_OPT_PSWD= WSREP_SST_OPT_SST_VER=sst_ver WSREP_SST_OPT_SUFFIX_DEFAULT= WSREP_SST_OPT_USER= IPv4 test: . scripts/wsrep_sst_common.sh --address ipv4:port/module/lsn_version/sst_ver/some_future_option1/some_future_option2 $ set | grep WSREP_SST WSREP_SST_OPT_ADDR=ipv4:port/module/lsn_version/sst_ver/some_future_option1/some_future_option2 WSREP_SST_OPT_AUTH= WSREP_SST_OPT_BINLOG= WSREP_SST_OPT_BYPASS=0 WSREP_SST_OPT_CONF=' ' WSREP_SST_OPT_DATA= WSREP_SST_OPT_DEFAULT= WSREP_SST_OPT_EXTRA_DEFAULT= WSREP_SST_OPT_HOST=ipv4 WSREP_SST_OPT_LSN=lsn_version WSREP_SST_OPT_MODULE=module WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2 WSREP_SST_OPT_PORT=port WSREP_SST_OPT_PSWD= WSREP_SST_OPT_SST_VER=sst_ver WSREP_SST_OPT_SUFFIX_DEFAULT= WSREP_SST_OPT_USER=
| | | | * wsrep_sst_common: parse_cnf - use awk rather than grep/cut/tail excessivenessDaniel Black2018-01-141-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test cases: f($var) = awk -v var="${var}" \ 'BEGIN { OFS=FS="="} { gsub(/_/,"-",$1); if ( $1=="--"var ) lastval=substr($0,length($1)+2) } END { print lastval }' Missing input is blank: $ echo '--var_aa=something' | f(var-b-not-ther) (blank as expected) All RHS of = is unmunged: $ echo '--var_aa=password==_-$' | f(var-aa) password==_-$ Mixed - and _ in var name: $ echo '--var_aa-bb_cc=1' | f(var-aa-bb-cc) 1 No value returns blank line: $ echo '--var_aa-bb_cc' | f(var-aa-bb-cc) (blank line as expected) Multiples return the last: $ echo -e "--bb=cc\n--bb=dd" | f(bb) dd
| | | | * Backport 4bb49d84a9df, correct handling on defaults[-extra]-file is SST scriptsSergei Golubchik2018-01-141-21/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (from 10.1 to 10.0-galera) This conflicted signficantly with 7d550c76be13c58551e203f4eeb4f87ebd58ba4b which added --defaults-group-suffix support. Took the approach of 4bb49d84a9df and adapted the --defaults-group-suffix handling to be consistent. The following changes as follows: SST scripts now use $MY_PRINT_DEFAULTS rather than the lowercase for consistency and this include all required --default arguements. Backport/merge by Daniel Black <daniel@linux.vnet.ibm.com>