Make sure we only update bucardo_truncate_trigger if we really need to, per report...
authorGreg Sabino Mullane <greg@endpoint.com>
Mon, 5 May 2014 14:29:03 +0000 (10:29 -0400)
committerGreg Sabino Mullane <greg@endpoint.com>
Mon, 5 May 2014 14:29:03 +0000 (10:29 -0400)
Bucardo.pm

index 83ecc623be9683ab5c5adf40fe3bc05e11f3dac6..f66976870fdb19a650a908af454ae9c507d91f28 100644 (file)
@@ -4608,7 +4608,7 @@ sub start_kid {
         ## If doing truncate, do some cleanup
         if (exists $self->{truncateinfo}) {
             ## For each source database that had a truncate entry, mark them all as done
-            $SQL  = 'UPDATE bucardo.bucardo_truncate_trigger SET replicated = now() WHERE sync = ?';
+            $SQL  = 'UPDATE bucardo.bucardo_truncate_trigger SET replicated = now() WHERE sync = ? AND replicated IS NULL';
             for my $dbname (@dbs_source) {
                 $x = $sync->{db}{$dbname};
                 $x->{sth} = $x->{dbh}->prepare($SQL, {pg_async => PG_ASYNC});