mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-26 23:45:44 +00:00
Fixes per Daniel's review
This commit is contained in:
33
bin/pt-kill
33
bin/pt-kill
@@ -1129,6 +1129,7 @@ if ( PTDEBUG ) {
|
||||
# ###########################################################################
|
||||
{
|
||||
package Lmo::Utils;
|
||||
|
||||
use strict;
|
||||
use warnings qw( FATAL all );
|
||||
require Exporter;
|
||||
@@ -1136,7 +1137,12 @@ our (@ISA, @EXPORT, @EXPORT_OK);
|
||||
|
||||
BEGIN {
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = @EXPORT_OK = qw(_install_coderef _unimport_coderefs _glob_for _stash_for);
|
||||
@EXPORT = @EXPORT_OK = qw(
|
||||
_install_coderef
|
||||
_unimport_coderefs
|
||||
_glob_for
|
||||
_stash_for
|
||||
);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -1320,7 +1326,6 @@ sub meta {
|
||||
return Lmo::Meta->new(class => $class);
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
}
|
||||
# ###########################################################################
|
||||
@@ -3264,10 +3269,24 @@ sub parse_event {
|
||||
$new_query = 1;
|
||||
}
|
||||
elsif ( $curr->[INFO] && defined $curr->[TIME]
|
||||
&& $query_start - $etime - $prev->[START] > $fudge ) {
|
||||
PTDEBUG && _d('Query restarted; new query',
|
||||
$query_start, $etime, $prev->[START], $fudge);
|
||||
$new_query = 1;
|
||||
&& $query_start - $etime - $prev->[START] > $fudge)
|
||||
{
|
||||
my $ms = $self->{MasterSlave};
|
||||
|
||||
my $is_repl_thread = $ms->is_replication_thread({
|
||||
Command => $curr->[COMMAND],
|
||||
User => $curr->[USER],
|
||||
State => $curr->[STATE],
|
||||
Id => $curr->[ID]});
|
||||
if ( $is_repl_thread ) {
|
||||
PTDEBUG &&
|
||||
_d(q{Query has restarted but it's a replication thread, ignoring});
|
||||
}
|
||||
else {
|
||||
PTDEBUG && _d('Query restarted; new query',
|
||||
$query_start, $etime, $prev->[START], $fudge);
|
||||
$new_query = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $new_query ) {
|
||||
@@ -4951,6 +4970,8 @@ use warnings FATAL => 'all';
|
||||
use English qw(-no_match_vars);
|
||||
use constant PTDEBUG => $ENV{PTDEBUG} || 0;
|
||||
|
||||
use Time::HiRes qw(sleep);
|
||||
|
||||
sub new {
|
||||
my ( $class, %args ) = @_;
|
||||
my $self = {
|
||||
|
Reference in New Issue
Block a user