mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-01-14 06:05:16 +08:00
Only rollback destination if it's defined
This change addresses https://jira.percona.com/browse/PT-2064 which causes PT-archiver to crash when hitting an error. We use pt-archiver to delete rows that shouldn't be moved to another destination, so `--dest` is not provided. In most places, we seem to check if `$dst` is actually defined before using it, so we might want to do the same in the `do_with_retries` function?
This commit is contained in:
@@ -7287,9 +7287,11 @@ sub do_with_retries {
|
||||
$success = $OUT_OF_RETRIES;
|
||||
}
|
||||
$get_sth->finish;
|
||||
trace('rollback', sub {
|
||||
$dst->{dbh}->rollback;
|
||||
});
|
||||
if ( $dst && $dst->{dbh} ) {
|
||||
trace('rollback', sub {
|
||||
$dst->{dbh}->rollback;
|
||||
});
|
||||
}
|
||||
trace('rollback', sub {
|
||||
$src->{dbh}->rollback;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user