mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 13:40:07 +00:00
Catch Deadlock error and retry.
This commit is contained in:
@@ -4894,7 +4894,7 @@ use warnings FATAL => 'all';
|
|||||||
use English qw(-no_match_vars);
|
use English qw(-no_match_vars);
|
||||||
use constant PTDEBUG => $ENV{PTDEBUG} || 0;
|
use constant PTDEBUG => $ENV{PTDEBUG} || 0;
|
||||||
|
|
||||||
use Time::HiRes qw(time);
|
use Time::HiRes qw(time sleep);
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
$Data::Dumper::Indent = 1;
|
$Data::Dumper::Indent = 1;
|
||||||
$Data::Dumper::Sortkeys = 1;
|
$Data::Dumper::Sortkeys = 1;
|
||||||
@@ -6585,7 +6585,7 @@ sub exec_nibble {
|
|||||||
|
|
||||||
return $retry->retry(
|
return $retry->retry(
|
||||||
tries => $o->get('retries'),
|
tries => $o->get('retries'),
|
||||||
wait => sub { return; },
|
wait => sub { sleep 0.25; return; },
|
||||||
try => sub {
|
try => sub {
|
||||||
# ###################################################################
|
# ###################################################################
|
||||||
# Start timing the query.
|
# Start timing the query.
|
||||||
@@ -6657,6 +6657,7 @@ sub exec_nibble {
|
|||||||
# The query failed/caused an error. If the error is one of these,
|
# The query failed/caused an error. If the error is one of these,
|
||||||
# then we can possibly retry.
|
# then we can possibly retry.
|
||||||
if ( $error =~ m/Lock wait timeout exceeded/
|
if ( $error =~ m/Lock wait timeout exceeded/
|
||||||
|
|| $error =~ m/Deadlock found/
|
||||||
|| $error =~ m/Query execution was interrupted/
|
|| $error =~ m/Query execution was interrupted/
|
||||||
) {
|
) {
|
||||||
# These errors/warnings can be retried, so don't print
|
# These errors/warnings can be retried, so don't print
|
||||||
|
Reference in New Issue
Block a user