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:
Jakob
2023-03-09 15:24:46 +01:00
committed by GitHub
parent 46a466efcc
commit 79757865e3

View File

@@ -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;
});