gh-ost icon indicating copy to clipboard operation
gh-ost copied to clipboard

Alternative use of gh-ost : Resync slave tables

Open babinomec opened this issue 4 years ago • 3 comments

Not really an issue, but rather another use of the tool that could be advertised in the documentation.

We have slaves that have discrepancies (missing rows, rows with some different values) as highlighted by a very long run of pt-table-checksum. We tried fixing these tables with pt-table-sync with no success.

By running gh-ost on a master using RBR (does not work with statement based replication) and doing a simple "engine=innodb", the whole table gets recreated with the data of the master thus fixing the differences that existed on the slave.

I think it's a nice usage of the tool that some other people could be made aware of (or maybe it is done already and I did not see it)

babinomec avatar Apr 16 '20 14:04 babinomec

@babinomec, would you be willing to create a PR adding this to the docs?

tomkrouper avatar Apr 16 '20 16:04 tomkrouper

I will try to find a decent location to put it and try to word it correctly :)

babinomec avatar Apr 17 '20 08:04 babinomec

We have slaves that have discrepancies (missing rows, rows with some different values) as highlighted by a very long run of pt-table-checksum. We tried fixing these tables with pt-table-sync with no success.

I do want to point out, that gh-ost is a good solution to get everything back in sync, but it will not solve the problem of having discrepancies in your replicas. You'd want to do other research to try to figure out why replicas are getting out of sync and how to fix them.

tomkrouper avatar Apr 17 '20 17:04 tomkrouper