When doing a DB master switchover, it is required to check if all the slaves are up-to-date with the current master before we can proceed with the switchover.
This is not as easy as running show slave status as even if the new master is on read_only, the pt-heartbeat will still be able to insert and thus the binlog position keeps changing.
What was initially discussed as a way to check whether the slaves caught up with the master is to check whether they Exec_Master_Log_Pos is equal or higher to the master show master status output.
Having a script to be able to check that for us instead of a one liner would be nice, if it can be done in parallel it is even better.
There will be snowflakes which would make this a bit more difficult.
Examples:
- dbstore servers are multi source, so we would need to pass an option to say which shard to check on the show slave status
- dbstore delayed replicas would need to be ignored.
- db1069 (until it remains alive) have different instances, so once we pass the shard we want to check, it needs to connect to the specific port for that shard