We have a replication slave that we want to rebuild from one it’s siblings (aka they’ll share the same MASTER_HOST) which has a mix of innodb and myisam tables All servers are running Percona 5.6.22. On the rebuilt slave, we stopped mysql, removed all the relaylogs and binlogs, as well as all of the data, and then ran this:
/usr/bin/innobackupex --host=${master} --user=${user} --password=********* --safe-slave-backup --slave-info --no-timestamp --use-memory=1000M /mysql/backup/dump
This gave us a copy of our database on the slave but in a different directory. We then rsync everything from /mysql/backup/dump/ to the datadir, chown the files, and confirm that both directories are the same number of bytes.
From the datadir, we then ran:
/usr/bin/innobackupex --apply-log ./
This looks good, and so we start the mysql service, login and issue CHANGE MASTER (with all the necessary config options) and START SLAVE. Then SHOW SLAVE STATUS displays:
Last_Error: Error executing row event: ‘Table ‘XXXX.YYYY’ doesn’t exist’
Despite that the table exists on the filesystem, and SHOW TABLES displays it as well.
We see this in the logs:
2015-10-21 15:44:22 45947 [Warning] InnoDB: Cannot open table XXXX/YYYY from the internal data dictionary of InnoDB though the .frm file for the table exists. See [url]http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html[/url] for how you can resolve the problem.
We’ve tried starting mysql server with innodb_force_recovery = 1
and innodb_force_recovery = 2
but those didn’t help either, and looked into “Restoring Orphaned File-Per-Table ibd Files” from the above link, but we have a large number of tables (at least 60 of YYYY across different XXXX shards) so doing all of that manually seems like overkill.
Any ideas on what we are doing wrong?