[MDEV-17618] Galera SST IPv6 problems Created: 2018-11-05  Updated: 2019-03-02  Resolved: 2019-02-28

Status: Closed
Project: MariaDB Server
Component/s: Galera SST
Affects Version/s: 10.1, 10.2, 10.3
Fix Version/s: 10.4.3, 10.1.38, 10.2.22, 10.3.13

Type: Bug Priority: Major
Reporter: Miika Kankare Assignee: Jan Lindström (Inactive)
Resolution: Fixed Votes: 2
Labels: ipv6

Issue Links:
Relates
relates to MDEV-11006 Galera config on ipv6 only hosts Closed
relates to MDEV-14030 Remove or Merge wsrep_sst_mariabackup Closed
relates to MDEV-14612 Galera SST xtrabackup-v2/mariabackup ... Closed
relates to MDEV-15496 IPv6 literal addresses in wsrep SST s... Closed
relates to MDEV-18797 Make mariabackup/xtrabackup-v2 SST sc... Closed

 Description   

I have been trying to create a Galera cluster with IPv6 networking. I know there's some other issues regarding this as well, I've probably read them.

There's at least a few problems:

wsrep_sst_common IPv6 address / port parsing is broken:

$ bash -vx './wsrep_sst_common.sh' --address '[2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2' 2>&1 |grep WSREP_SST_OPT_PORT
        readonly WSREP_SST_OPT_PORT="$2"
  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
    readonly WSREP_SST_OPT_PORT="$WSREP_SST_OPT_ADDR_PORT"
+ readonly 'WSREP_SST_OPT_PORT=[2001:db8::1]:3333'
+ WSREP_SST_OPT_PORT='[2001:db8::1]:3333'

I went through the history of the script, and I think this commit is the one breaking it: https://github.com/MariaDB/server/commit/c22ab56f0d690feee471e173a3d95acb642cd6dc#diff-0b1123372bd9bf8a76dd8dd90aa3808d

It was working after this pull request was merged: https://github.com/MariaDB/server/pull/644

I tried with xtrabackup-v2 and mariabackup. The other problem is that mariabackup doesn't even use the variables parsed by the common script, so the IPv6 things are parsed there again and it's broken too.

https://github.com/MariaDB/server/blob/10.2/scripts/wsrep_sst_mariabackup.sh#L519



 Comments   
Comment by Miika Kankare [ 2018-11-05 ]

I have yet to try a working wsrep_sst_common and xtrabackup-v2, maybe tomorrow.

There was another issue on merging / removing mariabackup, but nothing seems to have happened there: https://jira.mariadb.org/browse/MDEV-14030

Comment by Elena Stepanova [ 2018-11-05 ]

Set affects/fix versions based on the referenced commit only, without verification.

Comment by Miika Kankare [ 2018-11-06 ]

Currently trying with 10.2.18, but looks like this affects other versions too.

Comment by Miika Kankare [ 2018-11-06 ]

I first tried with the latest working version of wsrep_sst_common, namely: https://github.com/MariaDB/server/commit/6e55236c0a72e8f49a240c4e080591994042b0e4#diff-0b1123372bd9bf8a76dd8dd90aa3808d

But naturally exploded horribly, as it's missing the additions that have come afterwards: --binlog-index and --innodb-data-home-dir for example.

Then I grabbed the latest version of wsrep_sst_common from the 10.2 branch and reverted the few lines that ended up breaking the IPv6 parsing. This seemed to have worked, and the initial cluster creation and SST ran successfully.

--- wsrep_sst_common.sh.10.2  2018-11-06 10:30:07.000000000 +0200
+++ wsrep_sst_common.sh 2018-11-06 10:05:46.000000000 +0200
@@ -44,14 +44,17 @@
             addr_no_bracket=${WSREP_SST_OPT_ADDR#\[}
             readonly WSREP_SST_OPT_HOST_UNESCAPED=${addr_no_bracket%%\]*}
             readonly WSREP_SST_OPT_HOST="[${WSREP_SST_OPT_HOST_UNESCAPED}]"
+            remain=${WSREP_SST_OPT_ADDR#*\]}
+            remain=${remain#*:}
             ;;
         *)
             readonly WSREP_SST_OPT_HOST=${WSREP_SST_OPT_ADDR%%[:/]*}
             readonly WSREP_SST_OPT_HOST_UNESCAPED=$WSREP_SST_OPT_HOST
+            remain=${WSREP_SST_OPT_ADDR#*:}
             ;;
         esac
-        remain=${WSREP_SST_OPT_ADDR#${WSREP_SST_OPT_HOST}}
-        remain=${remain#:}
+        #remain=${WSREP_SST_OPT_ADDR#${WSREP_SST_OPT_HOST}}
+        #remain=${remain#:}
         readonly WSREP_SST_OPT_ADDR_PORT=${remain%%/*}
         remain=${remain#*/}
         readonly WSREP_SST_OPT_MODULE=${remain%%/*}

But this change will probably end up breaking something else, as the commit that introduced the changes had: "fix galera sst tests".

Comment by Jan Lindström (Inactive) [ 2019-02-28 ]

This problem seems to be fixed:

 bash -vx './wsrep_sst_common.sh' --address '[2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2' 2>&1 |grep WSREP_SST_OPT_PORT
        readonly WSREP_SST_OPT_PORT="$2"
  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
    readonly WSREP_SST_OPT_PORT="$WSREP_SST_OPT_ADDR_PORT"
+ readonly WSREP_SST_OPT_PORT=3333
+ WSREP_SST_OPT_PORT=3333

Generated at Thu Feb 08 08:37:50 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.