Not the answer you need?
Register and ask your own question!

pt-table-sync but no unique index

peter9370peter9370 EntrantCurrent User Role Contributor
I'm trying to fix an out-of-sync table on a slave database server, but pt-table-sync used with the --sync-to-master option won't work, because there is no unique index on the table. I assume that I will need to run pt-table-sync with the --nocheck-slave option (and cross my fingers) - but I'm puzzled by the following bit of the pt-table-sync documentation:

"Source and destination hosts must be independent; they cannot be in the same replication topology. pt-table-sync will die with an error if it detects that a destination host is a slave because changes are written directly to destination hosts (and it’s not safe to write directly to slaves)."

I assume that --nocheck-slave will override the behaviour described here - but there's nothing in the documentation to confirm this. Is this correct? I'd like to understand a bit more about what I'm trying to do, rather than just go ahead and risk turning a problem into a disaster!

(Presumably it would be a good idea to issue "stop slave" on the slave, before running pt-table-sync with the --nocheck-slave option?)

Comments

  • peter9370peter9370 Entrant Current User Role Contributor
    As no one replied to this, I assumed it probably wasn't a big deal - so I went ahead and tried to fix the out-of-sync table using pt-table-sync with the --nocheck-slave option, and master and slave defined using DSNs. And I'm delighted to report that it seems to have worked fine. (One piece of luck was that the table is very rarely updated, so there was little chance of problems when the slave threads were restarted. I'm not sure that it would have gone so well had the table been subject to heavy updating.)

    (If anyone who sees this is involved with maintaining the documentation, I'd suggest that the bit of the pt-table-sync manual mentioned above is changed to say that the refusal to work with a master/slave pair can be overridden with the --nocheck-slave option. With appropriate caveats, of course ...)
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.