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

Joiner fails to SST when upgraded to 10.1.28 from 10.1.23

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.1.28
    • Fix Version/s: 10.1.29
    • Component/s: Galera SST
    • Labels:
      None

      Description

      A Galera cluster uses encryption for SST with the following configuration:

      [sst]
      encrypt=3
      tkey=/path/to/key.pem
      tcert=/path/to/cert.pem
      tca=/path/to/ca.pem
      

      Upgrading a node to 10.1.28 (in a Galera cluster of 10.1.23 nodes) fails with:

      2017-11-04 18:23:17 140462627223296 [Note] WSREP: (3804918b, 'tcp://0.0.0.0:4567') turning message relay requesting off
      xb_stream_read_chunk(): wrong chunk magic at offset 0x0.
      WSREP_SST: [ERROR] Error while getting data from donor node: exit codes: 137 1 (20171104 18:24:55.419)
      WSREP_SST: [ERROR] Cleanup after exit with status:32 (20171104 18:24:55.421)
      

      One explication is that the joiner doesn't expect an encrypted stream, poining at a problem with the configuration under [sst] section.
      After some investigation I restricted the problem to the wsrep_sst_xtrabackup-v2's function parse_cnf() which was moved to wsrep_sst_common.

      In 10.1.23 parse_cnf() is in wsrep_sst_xtrabackup-v2 and it's:

      parse_cnf()
      {
          local group=$1
          local var=$2
          # print the default settings for given group using my_print_default.
          # normalize the variable names specified in cnf file (user can use _ or - for example log-bin or log_bin)
          # then grep for needed variable
          # finally get the variable value (if variables has been specified multiple time use the last value only)
          reval=$($MY_PRINT_DEFAULTS $group | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2- | tail -1)
          if [[ -z $reval ]];then
              [[ -n $3 ]] && reval=$3
          fi
          echo $reval
      }
      

      In 10.1.28 it's moved to wsrep_sst_common and it's:

      parse_cnf()
      {
          local group=$1
          local var=$2
          local reval=""
       
          # print the default settings for given group using my_print_default.
          # normalize the variable names specified in cnf file (user can use _ or - for example log-bin or log_bin)
          # then grep for needed variable
          # finally get the variable value (if variables has been specified multiple time use the last value only)
       
          # look in group+suffix
          if [[ -n $WSREP_SST_OPT_CONF_SUFFIX ]]; then
              reval=$($MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF "${group}${WSREP_SST_OPT_CONF_SUFFIX}" | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2- | tail -1)
          fi
       
          # look in group
          if [[ -z $reval ]]; then
              reval=$($MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF $group | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2- | tail -1)
          fi
       
          # use default if we haven't found a value
          if [[ -z $reval ]]; then
              [[ -n $3 ]] && reval=$3
          fi
          echo $reval
      }
               
      

      Using wsrep_sst_common and wsrep_sst_xtrabackup-v2 from version 10.1.23 on 10.1.28 fixes the problem and the node succesfully joins.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                claudio.nanni Claudio Nanni
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: