LP #1673399: Inconsistent creation of toolkit tables
Description
Environment
Smart Checklist
hideActivity

Michael Coburn August 5, 2019 at 2:07 PM
@Iwo Panowicz -
As discussed on Aug 5, can you review please and provide your perspective? Thanks,

Michael Coburn June 6, 2019 at 9:53 PM
@C W - Good point, there was some concern that if the database was created on a slave that it could later break replication. But CREATE TABLE IF NOT EXISTS
should be replication-safe.
@Carlos Salguero can we go ahead with the four tools mentioned above. Thanks,

C W May 16, 2019 at 12:52 PMEdited
@Michael Coburn why would you not create the schema when other scripts do?
CREATE DATABASE IF NOT EXISTS
i.e.
CREATE DATABASE IF NOT EXISTS
CREATE TABLE IF NOT EXISTS
Something extra to note is that it looks like the default schema varies too:
percona.checksums is default for checksums
percona_schema.clear_deadlocks would appear to be an expectation for deadlocks (as per https://jira.percona.com/browse/PT-1417?focusedCommentId=231675&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-231675)
$ find /usr/bin -maxdepth 1 -type f -name pt-\* | while read pt; do printf "%s - %s\n" "${pt}" "$($pt --help | fgrep percona.)"; done 2>/dev/null | fgrep -B1 percona.
/usr/bin/pt-mext -
/usr/bin/pt-table-checksum - default percona.checksums)
--ignore-tables percona.checksums
--replicate percona.checksums
$ find /usr/bin -maxdepth 1 -type f -name pt-\* | while read pt; do printf "%s - %s\n" "${pt}" "$($pt --help | fgrep percona_schema.)"; done 2>/dev/null | fgrep -B1 percona_schema.
/usr/bin/pt-upgrade - percona_schema.pt_upgrade)
--upgrade-table percona_schema.pt_upgrade
I suppose that these are probably most useful
pt-deadlock-logger
pt-heartbeat
pt-upgrade
pt-kill

Michael Coburn May 14, 2019 at 2:41 PM
Today @Roma Novikov, @Carlos Salguero and @Michael Coburn discussed:
We should check that the database exists when the tool starts up
We should not create the database
We estimate 2-4 hours per tool of Engineering investment. So @C W we have two questions for you:
Do you agree @C W with these points ?
Do you have a priority list of tools you would like to see this for first? Can we begin with pt-deadlock-logger and is that sufficient or do you have other tools?

Carlos Salguero November 22, 2018 at 12:48 PM
Since we shoudl analyze every program individually and there are no specific reported error, I am setting this ticket to on-hold
Details
Assignee
Carlos SalgueroCarlos Salguero(Deactivated)Reporter
C WC WPriority
LowFix versions
Labels
Smart Checklist Progress
1/1 - DoneStory Points
2Time tracking
No time logged
Details
Details
Assignee

Reporter

Priority
Fix versions
Labels
Smart Checklist Progress
Story Points
Time tracking
Smart Checklist
Open Smart Checklist
Smart Checklist
Open Smart Checklist
Smart Checklist

**Reported in Launchpad by Ceri WIlliams last update 04-09-2017 13:46:54
A number of the tools will write to a table, which in a replication scenario would require the slaves to contain the same table to avoid replication breakage (assuming no filters).
pt-table-checksum for example will use CREATE DATABASE IF NOT EXISTS and checks the slaves.
Please ensure that any of the tools that can write to a table also check that the schema exists and either completely fail to run (acceptable as safe) and give an error, or ensure that the schema and tables are created in a replication-safe manner.
For the following tools:
pt-deadlock-logger
pt-heartbeat
pt-upgrade
pt-kill
The following shows those scripts that contain a CREATE TABLE compared against those that contain a CREATE DATABASE:
@@ -1,16 +1,4 @@ -/usr/bin/pt-archiver -/usr/bin/pt-deadlock-logger -/usr/bin/pt-duplicate-key-checker -/usr/bin/pt-find -/usr/bin/pt-fingerprint -/usr/bin/pt-fk-error-logger -/usr/bin/pt-heartbeat /usr/bin/pt-index-usage -/usr/bin/pt-kill -/usr/bin/pt-mysql-summary -/usr/bin/pt-online-schema-change /usr/bin/pt-query-digest /usr/bin/pt-table-checksum -/usr/bin/pt-table-sync -/usr/bin/pt-table-usage /usr/bin/pt-upgrade