Jan Wieck JanWieck
Tue Dec 7 14:10:31 PST 2004
On 12/6/2004 8:23 PM, James Black wrote:
> Hello, all,
> 
> I'm in the process of moving over from a modified contrib/dbmirror 
> master/slave setup to Slony1.  Everything works ok, but in running 
> through testing the range of actions that we currently perform, I can't 
> figure out how to add tables to the cluster.  The sequence of events as 
> I understand them are: create a new table; create a new set; add the 
> new table to the new set; merge the new set into the old one.
> 
> Is it valid to merge a set into itself?  For example, given the 
> following slonik commands; tables foo and bar, with proper primary 
> keys; and a preexisting set id #1:
> 
> create set (id = 999, origin = 1, comment = 'temporary set');
> set add table (set id = 999, origin = 1, id = 1, full qualified name = 
> 'public.foo');
> set add table (set id = 999, origin = 2, id = 2, full qualified name = 
> 'public.bar');
> subscribe set ( id = 999, provider = 1, receiver = 2, forward = no );
> 
> ... is it kosher to merge a set into it's "origin"?  i.e.,
> 
> merge set (id = 1, add id = 999, origin = 1);

not only is it kosher, but the only way it works. The two sets you want 
to merge must have the same origin and an identical list of subscribers. 
Due to some sillyness in the way "subscribe set" currently works 
internally, you unfortunately cannot issue any "wait for event" to have 
the slonik script waiting until all the subscribers have finished 
copying the initial data for the new tables. So you will have to put the 
"merge set" part into a separate script run later.


Jan

> 
> ?
> 
> I apologize for the entry-level quality of this question; I am very 
> excited about replacing dbmirror, but I want to make sure that I am as 
> comfortable performing simple tasks with slony as with the current 
> setup first.
> 
> Thanks in advance,
> jfb
> 


-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck at Yahoo.com #


More information about the Slony1-general mailing list