mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-09 02:30:05 +00:00
Fix for 962330: pt-slave-delay incorrectly computes lag if started when slave is already lagging
This commit is contained in:
@@ -2355,9 +2355,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}
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user