Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-14612

Galera SST xtrabackup-v2/mariabackup scripts unnecessarily convert joiner address to host name

    Details

      Description

      When running on the donor node, the mariabackup and xtrabackup-v2 SST scripts unnecessarily convert the joiner's provided address to its host name. This happens in the following block of code:

      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 }')
              REMOTEHOST=$(getent hosts $REMOTEIP | awk '{ print $2 }')
              if [[ -z $REMOTEHOST ]];then
                  REMOTEHOST=$REMOTEIP
              fi
              lsn=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $4 }')
              sst_ver=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $5 }')
          else
              SST_PORT=$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $2 }')
          fi
      }
      

      https://github.com/MariaDB/server/blob/3d8aacba861044843417b710fff208b8bd6a53c4/scripts/wsrep_sst_mariabackup.sh#L504

      https://github.com/MariaDB/server/blob/3d8aacba861044843417b710fff208b8bd6a53c4/scripts/wsrep_sst_xtrabackup-v2.sh#L496

      This is probably not usually a big deal. However, it can cause issues when users try to work around the following socat bug:

      https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=695885

      The existing functionality makes it difficult to work around this bug, because even if wsrep_node_address is set to a host name or IP address that is compatible with socat, the SST script might still resolve the provided address to one that causes socat to break with the following error:

      2017/12/08 10:33:46 socat[23963] E getaddrinfo("10-1-1-237.mydomain.com", "(null)", {5,2,1,6}, {}): Name or service not known
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jplindst Jan Lindström
                Reporter:
                GeoffMontee Geoff Montee
              • Votes:
                2 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: