From 18e4e1f0e5b30884d3c1bea94d9b246e74b0dc70 Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Wed, 27 Jun 2012 15:53:09 -0600 Subject: [PATCH] Don't check slave lag on cluster nodes. --- bin/pt-table-checksum | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index d33611b1..049b09b4 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -6513,7 +6513,6 @@ sub main { my $master_dbh = $master_cxn->dbh(); # just for brevity my $master_dsn = $master_cxn->dsn(); # just for brevity - # ######################################################################## # If this is not a dry run (--explain was not specified), then we're # going to checksum the tables, so do the necessary preparations and @@ -6573,6 +6572,23 @@ sub main { $slave_lag_cxns = $slaves; } + # Cluster nodes aren't slaves, so SHOW SLAVE STATUS doesn't work. + # Nodes shouldn't be out of sync anyway because the cluster is + # (virtually) synchronous, so waiting for the last checksum chunk + # to appear should be sufficient. + @$slave_lag_cxns = grep { + my $slave_cxn = $_; + if ( $slave_cxn->is_cluster_node() ) { + warn "Not checking replica lag on " . $slave_cxn->name() + . " because it is a cluster node.\n"; + 0; + } + else { + PTDEBUG && _d('Will check slave lag on', $slave_cxn->name()); + $slave_cxn; + } + } @$slave_lag_cxns; + # ##################################################################### # Possibly check replication slaves and exit. # #####################################################################