New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MDEV-15496: wsrep_sst_common - parse IPv6 correct #644
Closed
grooverdan
wants to merge
5
commits into
MariaDB:10.0-galera
from
grooverdan:10.3-MDEV-15496-wsrep_sst_common_ipv6
Closed
MDEV-15496: wsrep_sst_common - parse IPv6 correct #644
grooverdan
wants to merge
5
commits into
MariaDB:10.0-galera
from
grooverdan:10.3-MDEV-15496-wsrep_sst_common_ipv6
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fix to e78e308, IPv6 got split at : Also got rid of awk (yuck!) to parse port (commit: b4fbb41) 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
dash as a unit test required the backport of f16ead5 (or minimal version as per below). diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh index b9d9d04fef6..6d5d77bea26 100644 --- a/scripts/wsrep_sst_common.sh +++ b/scripts/wsrep_sst_common.sh @@ -167,9 +167,8 @@ readonly WSREP_SST_OPT_AUTH # Splitting AUTH into potential user:password pair if ! wsrep_auth_not_set then - readonly AUTH_VEC=(${WSREP_SST_OPT_AUTH//:/ }) - WSREP_SST_OPT_USER="${AUTH_VEC[0]:-}" - WSREP_SST_OPT_PSWD="${AUTH_VEC[1]:-}" + WSREP_SST_OPT_USER="${WSREP_SST_OPT_AUTH%%:*}" + WSREP_SST_OPT_PSWD="${WSREP_SST_OPT_AUTH#*:}" fi readonly WSREP_SST_OPT_USER readonly WSREP_SST_OPT_PSWD |
Hi @grooverdan, Thanks for your contribution. Corresponding JIRA task: https://jira.mariadb.org/browse/MDEV-15496 This task was added to 10.3 backlog. Thanks, |
followup for 990c431 fix broken script (set -u)
Fix for 990c431 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
acceptable @SachinSetiya ? |
has been merged. Thanks @janlindstrom |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@SachinSetiya sorry for the break. Unit tested as below so far.
Fix to e78e308, IPv6 got split at :
Also got rid of awk (yuck!) to parse port (commit: b4fbb41)
Tested with dash to avoid bashisms:
I submit this under the MCA.