[MDEV-11314] MariaDB Galera Cluister issue with internal IPv6 GCOMM network Created: 2016-11-18  Updated: 2019-12-12  Resolved: 2019-12-12

Status: Closed
Project: MariaDB Server
Component/s: Galera SST
Affects Version/s: 10.1.17
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Richard Lane Assignee: Jan Lindström (Inactive)
Resolution: Fixed Votes: 6
Labels: galera
Environment:

RHEL7, internal IPv6 networking, 3 node Galera cluster


Attachments: File server.cnf     HTML File wsrep_sst_rsync    
Issue Links:
Relates
relates to MDEV-9890 wsrep_cluster_address does not accept... Closed
relates to MDEV-11006 Galera config on ipv6 only hosts Closed
relates to MDEV-18797 Make mariabackup/xtrabackup-v2 SST sc... Closed
Sprint: 5.5.59

 Description   

Configured internal IPv6 networking for galera cluster replication. First node creates new cluster successfully, but 2nd node is unable to join cluster when attempts SST rsync. Attached server.cnf is my /etc/my.cnf.d/server.cnf file.

After I fixed the wsrep_sst_rsync script (in code shown below), the 2nd node successfully joined the cluster over IPv6.

Here is the excerpt from /var/log/messages:

2016-11-18T03:33:04.049379+08:00 db0 mysqld: 2016-11-18  3:33:04 140673315493632 [Note] WSREP: Running: 'wsrep_sst_rsync --role 'joiner' --address '2500:face:4567::6' --datadir '/mariadb/data/'   --parent '16184'  '' '
2016-11-18T03:33:04.078435+08:00 db0 mysqld: rsync: face: invalid numeric value (in daemon mode)
2016-11-18T03:33:04.078547+08:00 db0 mysqld: (Type "rsync --daemon --help" for assistance with daemon mode.)
2016-11-18T03:33:04.078653+08:00 db0 mysqld: rsync error: syntax or usage error (code 1) at options.c(1005) [client=3.0.9]

This is a bug in the following code in teh wsrep_sst_rsync script that doesn't support IPv6 format address:

    ADDR=$WSREP_SST_OPT_ADDR
    RSYNC_PORT=$(echo $ADDR | awk -F ':' '{ print $2 }') 
    if [ -z "$RSYNC_PORT" ]
    then
        RSYNC_PORT=4444
        ADDR="$(echo $ADDR | awk -F ':' '{ print $1 }'):$RSYNC_PORT"
    fi



 Comments   
Comment by Jan Lindström (Inactive) [ 2017-03-02 ]

Hi, can you open a pull request for your contribution. Similar to other open source projects, the MariaDB Foundation needs to have shared ownership of all code that is included in the MariaDB distribution. The easiest way to achieve this is by submitting your code under the BSD-new license.

The other alternative is to sign the code contribution agreement which can be found here: https://mariadb.com/kb/en/mariadb/mca/

Please indicate in a comment in your pull request that you are contributing your new code of the whole pull request, including one or several files that are either new files or modified ones, under the BSD-new license or that you have filled out the contribution agreement and sent it.

Comment by Daniel Black [ 2018-04-10 ]

Test something like this (after MDEV-15496 is fixed) as the wsrep_sst_common parses the address into host/port components already:

diff --git a/scripts/wsrep_sst_rsync.sh b/scripts/wsrep_sst_rsync.sh
index 7fc83c1139c..f13930849f4 100644
--- a/scripts/wsrep_sst_rsync.sh
+++ b/scripts/wsrep_sst_rsync.sh
@@ -309,14 +309,7 @@ then
     fi
     rm -rf "$RSYNC_PID"
 
-    ADDR=$WSREP_SST_OPT_ADDR
-    RSYNC_PORT=$(echo $ADDR | awk -F ':' '{ print $2 }')
-    RSYNC_ADDR=$(echo $ADDR | awk -F ':' '{ print $1 }')
-    if [ -z "$RSYNC_PORT" ]
-    then
-        RSYNC_PORT=4444
-        ADDR="$(echo $ADDR | awk -F ':' '{ print $1 }'):$RSYNC_PORT"
-    fi
+    RSYNC_ADDR=$WSREP_SST_OPT_HOST
 
     trap "exit 32" HUP PIPE
     trap "exit 3"  INT TERM ABRT
@@ -346,7 +339,7 @@ EOF
 
     readonly RSYNC_PORT=${WSREP_SST_OPT_PORT:-4444}
     # If the IP is local listen only in it
-    if is_local_ip "$RSYNC_ADDR"
+    if is_local_ip "$WSREP_SST_OPT_HOST_UNESCAPED"
     then
       rsync --daemon --no-detach --address "$RSYNC_ADDR" --port "$RSYNC_PORT" --config "$RSYNC_CONF" &
     else

Untested is if the logic in check_pid_and_port. lsof seems to expects escaped however grep has non literal meanings for '[ipv6]'. This whole function needs to be rewritten to use the capabilities of lsof to get the right output parsing its output (example - see wsrep_sst_xtrabackup-v2)

Comment by Richard Lane [ 2018-05-01 ]

Can we have this looked at? Currently Galera does not support internal IPv6 network using rsync SST method. We have an application that wants to use Galera over IPv6 with rsync and they cannot get it to work. They have indicated that my workaround above did not work for them. I have requested their server.cnf file.

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

In my understanding this has been fixed on more recent versions.

Generated at Thu Feb 08 07:48:59 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.