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

Scheduler not handling pxc_maint_mode correctly

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 1.4.14
    • Fix Version/s: 1.4.16
    • Component/s: None
    • Labels:
      None
    • Needs QA:
      Yes

      Description

      The problem

      Acording to our online documentation at https://www.percona.com/doc/percona-xtradb-cluster/LATEST/howtos/proxysql.html scheduler should respect pxc_maint_transition_period to accommodate for long-running queries:

       

      You can increase the transition period using the pxc_maint_transition_period variable to accomodate for long-running transactions. If the period is long enough for all transactions to finish, there should hardly be any disruption in cluster workload.

      During the transition period, the node continues to receive existing write-set replication traffic, ProxySQL avoids openning new connections and starting transactions, but the user can still open conenctions to monitor status.

      However, that is not the case.
      In a PXC point of view, the workflow goes as below:

       

      1. Change the status to whatever was set as pxc_maint_mode
      2. Sleep for pxc_maint_transition_period

       

      If you want to set your writer to MAINTENANCE below work-flow will happen:

      • 1st run of the scheduler will:
        • Identify the server is on MAINTENANCE mode and change it's status to OFFLINE_SOFT - This node will handle the currently open connection. No new connection will be redirected to it
        • Promote a new node to become the new writer - This node will handle all new connections
      • 2nd run of the scheduler will (HERE IS THE BUG)
        • Remove old writer that is with status OFFLINE_SOFT, this will cause all current connections to be closed

       

      If for example, you have your scheduler configured to run every 1000ms and has pxc_maint_transition_period configure to 20 seconds, your stablished connections with MAINTANANCE master will be closed after 2 seconds (2 runs of the scheduler) and not after 20 seconds. 

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                kenn.takara Kenn Takara
                Reporter:
                marcelo.altmann Marcelo Altmann
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: