Merge fix-938068-ptc-slave-binlog-formats

This commit is contained in:
Daniel Nichter
2012-10-19 17:01:15 -06:00
2 changed files with 63 additions and 1 deletions

View File

@@ -8586,6 +8586,26 @@ sub main {
);
PTDEBUG && _d(scalar @$slaves, 'slaves found');
# https://bugs.launchpad.net/percona-toolkit/+bug/938068
if ( $o->get('check-binlog-format') ) {
my ($master_binlog) = $master_dbh->selectrow_array(
'SELECT @@binlog_format');
my $err = '';
for my $slave_cxn (@$slaves) {
my ($slave_binlog) = $slave_cxn->dbh->selectrow_array(
'SELECT @@binlog_format');
if ( $master_binlog ne $slave_binlog ) {
$err .= $master_cxn->name() . " has binlog_format "
. $master_binlog . " but replica " . $slave_cxn->name()
. " has binlog_format $slave_binlog. This could cause "
. "pt-table-checksum to break replication. "
. "If understand the risks, specify "
. "--no-check-binlog-format to disable this check.\n";
}
}
die $err if $err;
}
if ( $master_cxn->is_cluster_node() && !@$slaves ) {
die $master_cxn->name() . " is a cluster node but no other nodes "
. "or regular replicas were found. Use --recursion-method=dsn "
@@ -10506,6 +10526,14 @@ type: time; default: 1; group: Throttle
Sleep time between checks for L<"--max-lag">.
=item --[no]check-binlog-format
default: yes
Check that the C<binlog_format> is the same on all servers.
See "Replicas using row-based replication" under L<"LIMITATIONS">.
=item --[no]check-plan
default: yes
@@ -11322,7 +11350,12 @@ pt-table-checksum requires statement-based replication, and it sets
C<binlog_format=STATEMENT> on the master, but due to a MySQL limitation
replicas do not honor this change. Therefore, checksums will not replicate
past any replicas using row-based replication that are masters for
further replicas. (L<Bug 899415|https://bugs.launchpad.net/percona-toolkit/+bug/899415>)
further replicas.
The tool automatically checks the C<binlog_format> on all servers.
See L<"--[no]check-binlog-format">
(L<Bug 899415|https://bugs.launchpad.net/percona-toolkit/+bug/899415>)
=item Percona XtraDB Cluster