Percona XtraDB Cluster - HA scalable solution for MySQL

Make MacOSX and FreeBSD ports

Reported by Vladislav Klyachin on 2013-07-16
14
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Galera
Medium
Vladislav Klyachin
MySQL patches by Codership
Undecided
Vladislav Klyachin
Percona XtraDB Cluster
Undecided
Unassigned

Bug Description

Some files in wsrep patch contain platform-dependend code.
For example in sql/wsrep_utils.c:

// try to find the address of the first one
#if (TARGET_OS_LINUX == 1)
  const char cmd[] = "ip addr show | grep -E '^\\s*inet' | grep -m1 global |"
                     " awk '{ print $2 }' | sed 's/\\/.*//'";
#elif defined(__sun__)
  const char cmd[] = "/sbin/ifconfig -a | "
      "/usr/gnu/bin/grep -m1 -1 -E 'net[0-9]:' | tail -n 1 | awk '{ print $2 }'";
#else
  char *cmd;
#error "OS not supported"
#endif

also scripts files ./scripts/*.sh

It is required to make the code portable or to add support for MacOSX and FreeBSD.

Changed in codership-mysql:
assignee: nobody → Vladislav Klyachin (klyachin)

The 'ip addr show/ifconfig' method also fails on many non-trivial setups (as seen from previous bugs), getifaddrs (http://man7.org/linux/man-pages/man3/getifaddrs.3.html) is more appropriate.

Changed in percona-xtradb-cluster:
milestone: none → 5.5.32-23.7.6
Alex Yurchenko (ayurchen) wrote :

But, most importantly, note that this is not an essential feature, and actually should not be relied on in production. It conceptually can not be fixed in general (machines with multiple interfaces) and should not be spent effort on. A clear error message instructing user to configure wsrep_node_address variable should be enough.

#error preprocessor macro was added there to enforce explicit handling of every OS, but the OS does not have to be supported, just handled.

Vladislav Klyachin (klyachin) wrote :
Changed in codership-mysql:
status: New → Fix Committed
Alex Yurchenko (ayurchen) wrote :
Changed in galera:
assignee: nobody → Vladislav Klyachin (klyachin)
importance: Undecided → Medium
milestone: none → 23.2.7
status: New → Fix Committed
Changed in percona-xtradb-cluster:
status: New → Fix Committed
Changed in codership-mysql:
status: Fix Committed → Fix Released
Changed in galera:
status: Fix Committed → Fix Released
Changed in percona-xtradb-cluster:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers