Don't try to use pg_cancel if things blew up, simply rollback and set async_active...
authorGreg Sabino Mullane <greg@endpoint.com>
Wed, 7 May 2014 15:50:41 +0000 (11:50 -0400)
committerGreg Sabino Mullane <greg@endpoint.com>
Wed, 7 May 2014 15:50:41 +0000 (11:50 -0400)
Bucardo.pm

index f66976870fdb19a650a908af454ae9c507d91f28..853b83e48544d2fd7ed18785b6fda7140ac3a56a 100644 (file)
@@ -4951,17 +4951,13 @@ sub start_kid {
             for my $dbname (@dbs_dbi) {
                 my $x = $sync->{db}{$dbname};
                 my $dbh = $x->{dbh};
-                $self->glog("Attempting cleanup of database $dbname, async is $x->{async_active}", LOG_NORMAL);
-                ## Wrapped in an eval as a failure to serialise can cause an abort() and the KID will die.
-                if ($x->{async_active}) {
-                    $dbh->pg_cancel;
-                    $x->{async_active} = 0;
-                }
                 ## Seperate eval{} for the rollback as we are probably still connected to the transaction.
                 eval { $dbh->rollback; };
                 if ($@) {
                     $self->glog("Result of eval for rollback: $@", LOG_DEBUG);
                 }
+                ## We are certainly not async after this rollback
+                $x->{async_active} = 0;
             }
 
             # End the syncrun.