Uploaded image for project: 'ProxySQL Admin Scripts'
  1. ProxySQL Admin Scripts
  2. PSQLADM-98

Checking connection status to PXC nodes can stall proxysql_galera_checker script

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 1.4.9
    • Fix Version/s: 1.4.10
    • Component/s: None
    • Labels:
      None

      Description

      Based on failover tests, when PXC connection tests connect to the MySQL node shutting down, it can cause mysql command to stall:

      for i in "${CLUSTER_HOSTS[@]}"; do
       CLUSTER_HOSTNAME=$(echo $i | cut -d':' -f1)
       CLUSTER_PORT=$(echo $i | cut -d':' -f2)
       CHECK_SERVER_PORT=$( { printf "[client]\nuser=${MYSQL_USERNAME}\npassword=\"${MYSQL_PASSWORD}\"\nhost=${CLUSTER_HOSTNAME}\nport=${CLUSTER_PORT}\n" | mysql --defaults-file=/dev/stdin --protocol=tcp -Bse "select @@port" 2>/dev/null; } 2>&1 )
       if [[ -n $CHECK_SERVER_PORT ]]; then
       CHECK_MONITOR_USER=1
       break
       fi
      done

      Because of the stall, it takes 30 seconds to failover to other nodes. I would suggest to add "timeout" to mysql connection to speed up connection check:

       

      timeout 2 mysql --defaults-file=/dev/stdin --protocol=tcp -Bse "select @@port" 2>/dev/null

      With this additional setting, failover time takes 10 seconds.

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                kenn.takara Kenn Takara
                Reporter:
                jaime.sicam@percona.com Jaime Sicam
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: