[MDEV-15496] IPv6 literal addresses in wsrep SST scripts Created: 2018-03-06  Updated: 2018-11-05  Resolved: 2018-05-14

Status: Closed
Project: MariaDB Server
Component/s: Galera SST
Affects Version/s: 10.0.34-galera, 10.1.31, 10.2.13, 10.3.5
Fix Version/s: 10.1.34, 10.2.15, 10.3.7, 10.0.36-galera

Type: Bug Priority: Critical
Reporter: Julius Assignee: Jan Lindström (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Environment:

CentOS 7.4


Issue Links:
Relates
relates to MDEV-17618 Galera SST IPv6 problems Closed

 Description   

SST joiner address parsing in wsrep_sst_common script no longer works with IPv6 address literals since MariaDB 10.2.13. It used to work in MariaDB 10.2.12.

I seems problem was introduced in https://github.com/MariaDB/server/commit/e78e308e818a4a763ebb981302851f58f4c42bba.

Based on the test case included in commit message it would seem author made an assumption that IPv6 address literals will not contain colon symbols. Unfortunately enough it is not true.

Comparison of address parsing expressions:

MariaDB 10.2.13

(
  WSREP_SST_OPT_ADDR="[2001:db8::1]:4444/path";
  echo ${WSREP_SST_OPT_ADDR%%[:/]*};
)
// produces:
// [2001

MariaDB 10.2.12

(
  WSREP_SST_OPT_ADDR="[2001:db8::1]:4444/path";
  echo ${WSREP_SST_OPT_ADDR/\]*/\]};
)
// produces:
// [2001:db8::1]



 Comments   
Comment by Daniel Black [ 2018-03-07 ]

So sorry fln. Not so much as forgetting IPv6 has : just poor decisions and testing.

Originally had the following then (poorly) decided to move this outside the IPv6 if condition and add : to remove the port onwards separator. This combined with a poor test case.

${WSREP_SST_OPT_ADDR%%\]*}

Corrected per https://github.com/MariaDB/server/pull/644. Thanks for the bug report. Improved testing coming MDEV-15409.

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