From d24481461ea7fc1389bb4c6290108f671a7b9f40 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Tue, 4 Aug 2015 20:02:28 -0400 Subject: [PATCH] Change the way we signal syncs via kicks when makedelta is on. Go directly to the main database and gather a list of syncs that are using the current table, and which have autokick on, and which are active. --- Bucardo.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Bucardo.pm b/Bucardo.pm index ea3b63bed..04482843a 100644 --- a/Bucardo.pm +++ b/Bucardo.pm @@ -9910,12 +9910,16 @@ sub push_rows { }, undef, $d->{DBGROUPNAME}); } - $self->glog('Signalling all other syncs that this table has changed', LOG_DEBUG); + ## We want to send a kick signal to other syncs that are using this table + ## However, we do not want to kick unless they are set to autokick and active + + $self->glog('Signalling other syncs that this table has changed', LOG_DEBUG); ## Cache this if (! exists $self->{kick_othersyncs}{$syncname}{$tname}) { - $SQL = 'SELECT sync FROM bucardo.bucardo_delta_names WHERE sync <> ? AND tablename = ?'; - $sth = $dbh->prepare($SQL); - $count = $sth->execute($syncname,$tname); + #$SQL = 'SELECT sync FROM bucardo.bucardo_delta_names WHERE sync <> ? AND tablename = ?'; + $SQL = 'SELECT name FROM sync WHERE herd IN (SELECT herd FROM herdmap WHERE goat IN (SELECT id FROM goat WHERE schemaname=? AND tablename = ?)) AND name <> ? AND autokick AND status = ?'; + $sth = $self->{masterdbh}->prepare($SQL); + $sth->execute($goat->{schemaname}, $goat->{tablename}, $syncname, 'active'); $self->{kick_othersyncs}{$syncname}{$tname} = $sth->fetchall_arrayref(); } for my $row (@{ $self->{kick_othersyncs}{$syncname}{$tname} }) { -- 2.39.5