In cascaded replication scenario, delta table at primary slave (whose
changes will be propagated to the next cascaded slave) is not cleaned up by
VAC. Please refer to
http://abdulyadi.wordpress.com/2014/09/15/delta-table-clean-up-in-bucardo-5-cascaded-slave-replication/
for more explanation.
------------------------------
--------------------------------------------------------------------------
diff --git a/bucardo.schema b/bucardo.schema
index 1195c8c..46ec068 100644
--- a/bucardo.schema
+++ b/bucardo.schema
@@ -1924,8 +1924,11 @@ SELECT 'Fixme'::TEXT;
                       -- 3) Are older than the first argument interval
                       myst = 'DELETE FROM bucardo.'
                       || deltatable
-                      || ' USING (SELECT txntime AS tt FROM bucardo.'
+                      || ' USING (SELECT track.txntime AS tt FROM bucardo.'
                       || tracktable
+                      || ' track INNER JOIN bucardo.bucardo_delta_targets
bdt ON track.target=bdt.target '
+                      || ' WHERE bdt.tablename::regclass::text='
+                      || quote_literal(\$2)
                       || ' GROUP BY 1 HAVING COUNT(*) = '
                       || drows
                       || ') AS foo'
diff --git a/bucardo.schema b/bucardo.schema
index 1195c8c..46ec068 100644
--- a/bucardo.schema
+++ b/bucardo.schema
@@ -1924,8 +1924,11 @@ SELECT 'Fixme'::TEXT;
                       -- 3) Are older than the first argument interval
                       myst = 'DELETE FROM bucardo.'
                       || deltatable
-                      || ' USING (SELECT txntime AS tt FROM bucardo.'
+                      || ' USING (SELECT track.txntime AS tt FROM bucardo.'
                       || tracktable 
+                      || ' track INNER JOIN bucardo.bucardo_delta_targets bdt 
ON track.target=bdt.target '
+                      || ' WHERE bdt.tablename::regclass::text='
+                      || quote_literal(\$2)
                       || ' GROUP BY 1 HAVING COUNT(*) = '
                       || drows
                       || ') AS foo'
_______________________________________________
Bucardo-general mailing list
[email protected]
https://mail.endcrypt.com/mailman/listinfo/bucardo-general

Reply via email to