Details
-
Improvement
-
Status: Done
-
Medium
-
Resolution: Fixed
-
None
-
None
-
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.