The slowness problem can be easily fixed by the following change:
# diff -u /usr/bin/pt-archiver ../pt-archiver --- /usr/bin/pt-archiver 2015-01-23 10:30:15.000000000 +0000 +++ ../pt-archiver 2015-04-28 22:20:13.885862565 +0000 @@ -6075,6 +6075,8 @@ my $first_row = [ @$row ]; my $csv_row;
+ my $count; + ROW: while ( # Quit if: $row # There is no data @@ -6304,13 +6306,17 @@ PTDEBUG && _d('Got another row in this chunk'); }
+ $count++; + # Check slave lag and wait if slave is too far behind. - if ( $lag_dbh ) { + if ( $lag_dbh && $count % 100 == 0 ) {
which checks the replication lag every 100 rows instead of every 1 row. This significantly improves the efficiency.
The slowness problem can be easily fixed by the following change:
# diff -u /usr/bin/ pt-archiver ../pt-archiver pt-archiver 2015-01-23 10:30:15.000000000 +0000
--- /usr/bin/
+++ ../pt-archiver 2015-04-28 22:20:13.885862565 +0000
@@ -6075,6 +6075,8 @@
my $first_row = [ @$row ];
my $csv_row;
+ my $count;
+
ROW:
while ( # Quit if:
$row # There is no data
@@ -6304,13 +6306,17 @@
PTDEBUG && _d('Got another row in this chunk');
}
+ $count++;
+
# Check slave lag and wait if slave is too far behind.
- if ( $lag_dbh ) {
+ if ( $lag_dbh && $count % 100 == 0 ) {
which checks the replication lag every 100 rows instead of every 1 row. This significantly improves the efficiency.