wsrep_sst_xtrabackup-v2 still doesn't support IPv6

Bug #1652840 reported by James Brown
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
New
Wishlist
Kenn Takara

Bug Description

I'm upgrading our XtraDB Cluster install from 5.6.30 to 5.6.34, and I wanted to point out that the newly-rewritten wsrep_sst_xtrabackup-v2 *still* does not support IPv6.

Specific issues:

   * Address parsing (in `setup_ports()`) still doesn't handle IPv6 address literals with colons in them.
   * `socat` creates IPv4-only sockets (using `TCP-LISTEN:`) instead of dual-stack sockets (using `TCP6-LISTEN:` on most modern linuxes)

I have our puppet install patching this file, but it's incredibly annoying to have to port our patches to every new release. It would be great if this tool could support IPv6 natively.

The current patch I'm using is below:

--- wsrep_sst_xtrabackup-v2 2016-12-13 08:53:55.000000000 +0000
+++ /proc/self/fd/11 2016-12-27 21:19:50.991911578 +0000
@@ -385,11 +385,11 @@
             if [[ $encrypt -eq 1 ]]; then
                 wsrep_log_warning "**** WARNING **** encrypt=1 is deprecated and will be removed in a future release"
             fi

             if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]]; then
- tcmd="socat -u TCP-LISTEN:${TSST_PORT},reuseaddr${sockopt} stdio"
+ tcmd="socat -u TCP6-LISTEN:${TSST_PORT},reuseaddr${sockopt} stdio"
             else
                 tcmd="socat -u stdio TCP:${REMOTEIP}:${TSST_PORT}${sockopt}"
             fi
         fi
     fi
@@ -634,16 +634,19 @@
 }

 setup_ports()
 {
     if [[ "$WSREP_SST_OPT_ROLE" == "donor" ]];then
- SST_PORT=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $2 }')
- REMOTEIP=$(echo $WSREP_SST_OPT_ADDR | awk -F ':' '{ print $1 }')
- lsn=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $4 }')
- sst_ver=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $5 }')
+ SST_PORT=$(echo ${WSREP_SST_OPT_ADDR##*:} | tr -d [])
+ REMOTEIP="$(echo ${WSREP_SST_OPT_ADDR%:*} | tr -d [])"
+ if [[ "$REMOTEIP" =~ : ]] ; then
+ REMOTEIP="[$REMOTEIP]"
+ fi
+ lsn=$(echo $WSREP_SST_OPT_ADDR | awk -F '[/]' '{ print $3 }' | tr -d [])
+ sst_ver=$(echo $WSREP_SST_OPT_ADDR | awk -F '[/]' '{ print $4 }' | tr -d [])
     else
- SST_PORT=$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $2 }')
+ SST_PORT=$(echo ${WSREP_SST_OPT_ADDR##*:} | tr -d [])
     fi
 }

 # waits ~10 seconds for nc to open the port and then reports ready
 # (regardless of timeout)

affects: percona-server → percona-xtradb-cluster
Changed in percona-xtradb-cluster:
assignee: nobody → Kenn Takara (kenn-takara)
Changed in percona-xtradb-cluster:
importance: Undecided → Wishlist
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXC-765

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.