I have tried using a replica as the source to create a new replica using the clone plugin. All goes well except the binlog_file, binlog_position from performance_schema.clone_status shows a different log and position than the the source replica. The source replica does show the correct log and position. Is this not possible to clone a new replica this way? My other thought is to stop replication on the source replica and get the log and position and hold replication until the clone finishes. But I am not sure this is the best way to handle this. Suggestions?
Hey @jknight,
Ideally, you shouldn’t be concerning yourself with binlog filenames/positions, and instead rely on GTID. By using GTID, it doesn’t matter what the filename/pos are.
I’ve used the CLONE plugin before, but never to create a replica from a replica. From your description, it seems the plugin assumes the clone’d server (ie: the replica) is the actual source mysql, instead of the upstream source. I bet the binlog info you are seeing is that of the replica. What you end up with is A→B→C but what you really want is A→B and A→C.
You can still accomplish this. Let the clone process finish. Once B→C is up to date, stop replica on C, execute change replication source to source_host=A and start replication back up. It should pick up right were it left off thanks to GTIDs.
Yes the plan is to get to GTID, but this set up has been bandaided for a long time and I am tasked with getting them up-to-date. I appreciate you input.
Use Percona Xtrabackup then to create your replica. It has a feature to collect the binary log coordinates from the replica’s source. Use --safe-slave-backupand --slave-info when you take the backup of the replica.
Matthewb, That is certainly an option. Thank you for your response