Uploaded image for project: 'Percona Toolkit'
  1. Percona Toolkit
  2. PT-1508

Adding --read-only-interval flag, and read-only check on wake-up

    Details

    • Type: Improvement
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.9
    • Component/s: None
    • Labels:
      None

      Description

      First, please let me know if this should go into 3.0 branch.

      This PR adds better handling for read-only. Assuming --check-read-only is set:

      • The new optional --read-only-interval flag will make for a different sleep time in between read-only checks (and for as long as the server is read-only).
        If unspecified, resort to --interval.
        Why? We run with --interval=0.1, and wish to run pt-heartbeat individually on all our servers. It's pointless to have replicas being hammered every 0.1s with a select @@read_only query. We wish to have a different interval, like every 1s, as long as the server is read-only.
      • When waking up, re-check read-only.
        This is useful in the event a server that was writable, and had heartbeat injected, turns read-only (as in the case of a planned master promotion). In which case, we again wish to introduce the read-only-interval sleep time.

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                carlos.salguero Carlos Salguero
                Reporter:
                carlos.salguero Carlos Salguero
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 5 hours
                  5h