Merge lp:~percona-toolkit-dev/percona-toolkit/pt-heartbeat-check-read-only-option-does-not-prevent-creates-or-inserts-1328686 into lp:~percona-toolkit-dev/percona-toolkit/release-2.2.12
Proposed by
Frank Cizmich
Status: | Merged |
---|---|
Merged at revision: | 636 |
Proposed branch: | lp:~percona-toolkit-dev/percona-toolkit/pt-heartbeat-check-read-only-option-does-not-prevent-creates-or-inserts-1328686 |
Merge into: | lp:~percona-toolkit-dev/percona-toolkit/release-2.2.12 |
Diff against target: |
36 lines (+26/-0) 1 file modified
bin/pt-heartbeat (+26/-0) |
To merge this branch: | bzr merge lp:~percona-toolkit-dev/percona-toolkit/pt-heartbeat-check-read-only-option-does-not-prevent-creates-or-inserts-1328686 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel Nichter | Needs Fixing | ||
Review via email: mp+239767@code.launchpad.net |
Description of the change
Problem:
Some users need to start pt-heartbeat on a server with read_only enabled, and enable writing at a later time.
The tool only checks for this after initializing tables and doing the first row insert, thus it fails if it begins to run on a read_only server.
Fix:
Before initializing, if --check-read-only and --update options are given, the tool waits for read_only to be disabled , checking at regular intervals.
--run-time is also honored, so if it is still waiting when run-time is reached, it exits.
To post a comment you must log in.
This duplicates some code, but trying to avoid that seems to complicate things too much.