Marc Munro marc
Fri Mar 31 12:19:29 PST 2006
I have been experimenting with exactly this sort of scheme.  It's not
simple but in tests it has worked well enough.

I can't share the code but the general approach is that each partition
is processed in a number of distinct stages.  All of the processing is
done within the database, at the provider node, in plpgsql functions.

For each new partition the steps taken are:

 1)  Create the table (eg mytab_200603)
 2)  Create a temporary replication set
 3)* Add the new table to the temporary replication set
 4)* Subscribe all subscriber nodes to the temporary replication set
 5)* Merge the temporary replication set with the main set
 6)  Activate the partition

The steps marked with an asterisk must wait until the previous steps
have been completed at all slony nodes.  I do this be scheduling each
step a number of days in advance of the time the partition must become
active, and running queries at the subscriber nodes, using dblink, to
test that the previous step has completed.



More information about the Slony1-general mailing list