Scenario: Simple Master->Slave setup. I want to add an index to a table on the slave. Replication is caught up and fine. I launch pt-osc to do the work on the slave, specifying “–no-swap-tables”
After the script is done, running some simple checks to compare the two tables, I find that the COUNT(*) is off.
Going through the masters binlog, I can see 14 DELETE statements which is exactly how many the COUNT() is off by.
When one of the DELETE’s came down the repl pipe, the trigger fired off but because those rows hadn’t been copied to the new table yet, nothing happened.
The same goes for UPDATE. Upon doing some checksums between the two tables, we find that values in the new table were not updated because when the trigger for UPDATE on orig table fired off, the row on new didn’t exist yet.
What’s the workaround for this other than doing STOP SLAVE before running the script?