Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PT-1508 Adding --read-only-interval flag, and read-only check on wake-up #302

Merged
merged 14 commits into from Mar 26, 2018
Merged

Conversation

shlomi-noach
Copy link

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.

Thank you.

@CLAassistant
Copy link

CLAassistant commented Feb 13, 2018

CLA assistant check
All committers have signed the CLA.

@shlomi-noach
Copy link
Author

Oh, and apparently my editor stripped quite a few trailing spaces. Please let me know if you wish to retain those spaces.

@shlomi-noach
Copy link
Author

For your convenience, adding ?w=1 to the URL diffs without spaces: https://github.com/percona/percona-toolkit/pull/302/files?w=1

@shlomi-noach
Copy link
Author

shlomi-noach commented Feb 13, 2018

I did sign the Contributor License Agreement. And @tomkrouper merely issued a merge from master.

@rnovikovP
Copy link
Contributor

@shlomi-noach , unfortunately, cla-assistant.io can't get your sign ( can you re-click on the button above from cla-assistant. Thanks

@shlomi-noach
Copy link
Author

@rnovikovP I think I may have used a different email address. I will try again.

@shlomi-noach
Copy link
Author

OK, I'm good! As per @tomkrouper 's merge commit, maybe I'll squash it or something.

@tomkrouper
Copy link
Contributor

I’ve signed the cla.

@shlomi-noach
Copy link
Author

shlomi-noach commented Feb 26, 2018

Also added e1b8e2f: --fail-successive-errors

=item --fail-successive-errors

type: int

If specified, pt-heartbeat will fail after given number of successive DBI errors
(failure to connect to server or issue a query).

This is useful when MySQL goes away. pt-heartbeat seems unable to reconnect to the MySQL server if the MySQL server is restarted, for example. --fail-successive-errors allows us to bail out after n sequential failures. A single success resets the counter.

This commit fixes https://bugs.launchpad.net/percona-toolkit/+bug/1629164
JIRA: https://jira.percona.com/browse/PT-1386

@shlomi-noach
Copy link
Author

Friendly ping. Any thoughts on the above?

@percona-csalguero
Copy link
Contributor

Hi,

Thank you very much for the improvements.
I've created: https://jira.percona.com/browse/PT-1508 to track this PR.
This must be merged in 3.0 branch. Could you change the PR please? It shouldn't be any problem. I already merged it in my local and ran the tests and everything is OK.

Regards

@shlomi-noach shlomi-noach changed the base branch from 2.2 to 3.0 March 19, 2018 18:37
@shlomi-noach
Copy link
Author

I changed the base to 3.0. There's a conflict with README that I seem to be unable to solve.

FYI whitespace is a big issue with pt code. It is inconsistent.

@shlomi-noach
Copy link
Author

Fixed README conflict. Trailing whitespace.

@rnovikovP rnovikovP changed the title Adding --read-only-interval flag, and read-only check on wake-up PT-1508 Adding --read-only-interval flag, and read-only check on wake-up Mar 24, 2018
@percona-csalguero percona-csalguero merged commit 1237332 into percona:3.0 Mar 26, 2018
@shlomi-noach shlomi-noach deleted the read-only-interval branch March 26, 2018 14:40
@shlomi-noach
Copy link
Author

Woot! Thank you

dveeden pushed a commit to dveeden/percona-toolkit that referenced this pull request Apr 16, 2020
PT-1508 Adding --read-only-interval flag, and read-only check on wake-up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants