Taking a fresh look at this, I remembered having already dealt with this issue:
# Requiring "AND master_crc IS NOT NULL" avoids a race condition
# when the system is fast but replication is slow. In such cases,
# we can select on the slave before the update for $update_sth
# replicates; this causes a false-positive diff.
my $sql = "SELECT MAX(chunk) FROM $repl_table "
. "WHERE db='$tbl->{db}' AND tbl='$tbl->{tbl}' "
. "AND master_crc IS NOT NULL";
That was put in in 2.0. So #1-#4 (comment #17) shouldn't be able to happen before #5. Maybe something else is wrong. I'm taking another look.
Taking a fresh look at this, I remembered having already dealt with this issue:
# Requiring "AND master_crc IS NOT NULL" avoids a race condition
# when the system is fast but replication is slow. In such cases,
# we can select on the slave before the update for $update_sth
# replicates; this causes a false-positive diff.
my $sql = "SELECT MAX(chunk) FROM $repl_table "
. "WHERE db='$tbl->{db}' AND tbl='$tbl->{tbl}' "
. "AND master_crc IS NOT NULL";
That was put in in 2.0. So #1-#4 (comment #17) shouldn't be able to happen before #5. Maybe something else is wrong. I'm taking another look.