pt-table-sync error The server specified as a master has no connected slaves

I have four MySQL databases in a sandbox for testing set up as follows:

M → S1
M → S2
S1 → S3

(Master localhost:5999 , Slave1 localhost:5998, Slave2 localhost:5997, Slave3 localhost:5996)

I deleted 1,000 rows from a table in Slave3 so I can test pt-table-sync to restore the rows from Slave1. I execute the command as follows:

pt-table-sync --execute --sync-to-master localhost --port=5996 --user=<username> --ask-pass --socket=/tmp/mysql_sandbox5996.sock --verbose

But I get the error message

Reading the documentation it looks like if I use --sync-to-master then I specify the slave connection information. I tried it by specifying the master information with the options and the slave as a DSN and it doesn’t look at the slave at all.

Is there a way to explicitly declare --master= --slave= and still have it ask for the password?

Thanks in advance,

Edward Hooper

Hi Edward,

I tried replicating your issue to no avail for the moment. What version are you currently using of the percona toolkit. Could you give me the full output of the command? Does the user in place have the right to the see the replication status (replication_client)?

It couldn’t connect to the other host because Perl::DBI needs the socket when the hostname is localhost. I only knew how to pass the socket for one of the connections and not both so it defaulted to /var/lib/mysql/mysql.sock (or what ever the default is) and it doesn’t exist.

When I started using the actual hostname of the server for the connection information the problem went away. But I had to set the hostname everywhere to make it work.

If there are any devs reading, I’d like to request an update to the tools with the following options:

–master-socket=
–slave-socket=[, …]