From 038b0431ef3d78f391598c7ab2a913b889321f99 Mon Sep 17 00:00:00 2001 From: frank-cizmich Date: Mon, 27 Apr 2015 11:22:01 -0300 Subject: [PATCH] pt-archiver corrected excessively frequent lag check --- bin/pt-archiver | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/pt-archiver b/bin/pt-archiver index 7de572c6..31a8dfab 100755 --- a/bin/pt-archiver +++ b/bin/pt-archiver @@ -6074,6 +6074,7 @@ sub main { # This row is the first row fetched from each 'chunk'. my $first_row = [ @$row ]; my $csv_row; + my $lag_count = 0; ROW: while ( # Quit if: @@ -6305,7 +6306,8 @@ sub main { } # Check slave lag and wait if slave is too far behind. - if ( $lag_dbh ) { + # Do this check every 100 rows + if ( $lag_dbh && $lag_count++ % 100 == 0 ) { my $lag = $ms->get_slave_lag($lag_dbh); while ( !defined $lag || $lag > $o->get('max-lag') ) { PTDEBUG && _d('Sleeping: slave lag is', $lag);