Merged fix-962330-already-lagged-slave

This commit is contained in:
Brian Fraser
2012-07-12 22:41:04 -03:00
parent a9031c5993
commit 1cf7ec210f

View File

@@ -2345,9 +2345,16 @@ sub main {
|| $pos->[$FILE] ne $status->{master_log_file}
|| $pos->[$POS] != $status->{read_master_log_pos} )
{
push @positions,
[ $now, $status->{master_log_file},
$status->{read_master_log_pos} ];
push @positions, [
# Bug 962330: pt-slave-delay incorrectly computes lag if
# started when slave is already lagging.
# That happened because for an already lagged slave, $now
# isn't the correct time, but is actually
# $now - $seconds_lagged.
$now - ( $status->{seconds_behind_master} || 0 ),
$status->{master_log_file},
$status->{read_master_log_pos}
];
}
}