Make sure makedelta can be set on all databases, source *and* target.
authorGreg Sabino Mullane <greg@endpoint.com>
Fri, 5 Sep 2014 16:54:55 +0000 (12:54 -0400)
committerGreg Sabino Mullane <greg@endpoint.com>
Fri, 5 Sep 2014 16:54:55 +0000 (12:54 -0400)
Per blog post: http://abdulyadi.wordpress.com/2014/09/01/bucardo-5-cascaded-slave-replication/

Bucardo.pm

index d75d806b9dfe839afca66d49162bfd4c95f48de6..3eafd97bea12f5c1c712974f52294e00682208e4 100644 (file)
@@ -2960,6 +2960,23 @@ sub start_kid {
                     ($SQL = $SQL{stage}{$g}) =~ s/DBGROUP/'$x->{DBGROUPNAME}'/go;
                     $sth{stage}{$dbname}{$g} = $x->{dbh}->prepare($SQL, {pg_async => PG_ASYNC});
 
+
+                } ## end each table
+
+            } ## end each source database
+
+
+            ## Set all makedelta tables (can be target databases too, as another sync may have them as a source)
+            for my $dbname (@dbs) {
+
+                $x = $sync->{db}{$dbname};
+
+                for my $g (@$goatlist) {
+
+                    next if $g->{reltype} ne 'table';
+
+                    ($S,$T) = ($g->{safeschema},$g->{safetable});
+
                     ## Set the per database/per table makedelta setting now
                     if (defined $g->{makedelta}) {
                         if ($g->{makedelta} eq 'on' or $g->{makedelta} =~ /\b$dbname\b/) {
@@ -2970,7 +2987,8 @@ sub start_kid {
 
                 } ## end each table
 
-            } ## end each source database
+            } ## end all databases
+
 
         } ## end if delta databases