Duplicated queries in the binlog for pt-table-checksum

8 views
Skip to first unread message

Alfie

unread,
Oct 26, 2011, 6:58:37 PM10/26/11
to Percona Dev
Hi,

I noticed that the queries in the binlog generated by pt-table-
checksum looked like it was duplicating work:

REPLACE INTO percona.checksums ( ... 'YYY' as cnt, 'XXX as crc )
UPDATE percona.checksums ( ... master_crc = 'XXX', master_cnt =
'YYY' ... )

Also in 'after_nibble', there's a comment that I'm not understanding:

# We're working on the master, so update the checksum's master_cnt
and master_crc.
$update_sth->execute( ... )

Now the $update_sth statement is run, which gets binlogged, which gets
replicated. Since there is no 'SET SQL_LOG_BIN=0' I'm guessing that
the update statement is run everywhere. So why the comment?

Am I missing something here?

Baron Schwartz

unread,
Nov 7, 2011, 4:36:32 PM11/7/11
to perco...@googlegroups.com
Alfie,

The REPLACE and UPDATE actually touch different columns, so they're
not duplicates. The comment in after_nibble reflects the legacy of
the code a bit, and isn't the best comment, I'd say. Sorry for the
confusion.

Check out the latest unreleased code -- it has better docs.

> --
> You received this message because you are subscribed to the Google Groups "Percona Dev" group.
> To post to this group, send email to perco...@googlegroups.com.
> To unsubscribe from this group, send email to percona-dev...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/percona-dev?hl=en.
>
>

--
Baron Schwartz
Percona Inc <http://www.percona.com/>
Consulting, Training, Support & Services for MySQL

Reply all
Reply to author
Forward
0 new messages