New makedelta plan: do not rely on ALWAYS triggers (too many side effects), but looku...
authorGreg Sabino Mullane <greg@endpoint.com>
Sun, 15 Jun 2014 15:58:11 +0000 (11:58 -0400)
committerGreg Sabino Mullane <greg@endpoint.com>
Sun, 15 Jun 2014 15:58:11 +0000 (11:58 -0400)
Bucardo.pm
bucardo.schema

index acb1980eff16b1bd346e017b6f038512629c7103..27a4658a71e6d862d7521e2f7b0fd85802c0a29f 100644 (file)
@@ -9578,6 +9578,15 @@ sub push_rows {
                         INSERT INTO bucardo.$goat->{tracktable}
                         VALUES (NOW(), ?)
                     }, undef, $x->{DBGROUPNAME});
+
+                    $self->glog("Signalling all other syncs that this table has changed", LOG_DEBUG);
+                    $SQL = 'SELECT sync FROM bucardo.bucardo_delta_names WHERE sync <> ? AND tablename = ?';
+                    $sth = $dbh->prepare($SQL);
+                    $count = $sth->execute($syncname,$tname);
+                    for my $row (@{ $sth->fetchall_arrayref }) {
+                        my $othersync = $row->[0];
+                        $self->db_notify($dbh, "kick_sync_$othersync");
+                    }
                 }
             }
             elsif ('flatpg' eq $type) {
index 14097de1966e4ae70ec0958b361a814faf4a7013..98cb5355a80768ae18cd9d1885a6fcce83c1d672 100644 (file)
@@ -2543,12 +2543,6 @@ SELECT 'Fixme'::TEXT;
                 }
                 $run_sql->($SQL,$dbh);
 
-                ## We want these to always fire, even in replica mode!
-                if ($dbh->{pg_server_version} >= 80300) {
-                    $SQL = qq{ALTER TABLE $safeschema.$safetable ENABLE ALWAYS TRIGGER "$kickfunc"};
-                    $run_sql->($SQL,$dbh);
-                }
-
             }
         } ## end each TABLE
     }     ## end each SCHEMA