Dane Miller dane at greatschools.net
Wed Jul 2 10:27:41 PDT 2008
Hi Slony Friends,

Like many of you, I followed the recent thread about SUBSCRIBE SET/WAIT
FOR EVENT (labeled with the unhelpful subject line "Slony1-general
Digest, Vol 16, Issue 27").  Excerpted here...

On Thu, 2008-06-26 at 08:26 -0500, Troy Wolf wrote:
> Alexander, I don't know if this is the missing magic, but compare your
> code to the the code Chris Browne posted:
> 
> On Wed, Jun 25, 2008 at 2:20 PM, Alexander Staubo <alex at bengler.no>
> wrote:
> >> SUBSCRIBE SET (ID=1, PROVIDER=1, RECEIVER=2);
> >> WAIT FOR EVENT (ORIGIN=2, CONFIRMED = 1);
> >> SYNC(ID = 1);
> >> WAIT FOR EVENT (ORIGIN=1, CONFIRMED=2);
> 
> Chris Browne:
> subscribe set (id=1, provider=1, receiver=2, forward=yes);
> sync(id=1);    # Submits a SYNC event
> wait for event (origin=all, confirmed=2, wait on=1);   # Waits for
> that event to be confirmed on node #2
> 
> First notice that the WAIT FOR EVENT after the SUBSCRIBE is useless.
> It tells you nothing. Second, notice the "origin=all" and "wait on=1"
> in the WAIT FOR EVENT after the SYNC. Perhaps these are important
> ingredients? 

IMO, two very important pieces of information resulted from this thread,
that I think are worth highlighting:

   1) The correct usage of WAIT FOR EVENT is...
       WAIT FOR EVENT (origin=all, confirmed=2, wait on=1)

   2) SYNC and WAIT FOR EVENT must happen in the same slonik request.

Note that #1 is wrong in the documentation here
http://www.slony.info/documentation/addthings.html.  Perhaps this is
already fixed in the documentation in CVS... who knows? Why is this not
a wiki, I'd have fixed it myself?

Perhaps this is a good time to ask for clarification on WAIT FOR EVENT
usage.  What are the proper values for w, x, y, z given the following:
     SUBSCRIBE SET (ID = 999, PROVIDER = 10, RECEIVER = 20);
     SYNC (ID=w);
     WAIT FOR EVENT (ORIGIN = x, CONFIRMED = y, WAIT FOR = z);

Furthermore, is there a relationship between these values that always
holds true?  For example, w = x = z.

Perhaps also a good time to bring up the topic of a slony community wiki
to keep documentation fresh and spread the load among slony community
members.  Lots of smart people on this list would like to give back.
Let us.

Dane
-- 
Dane Miller
Systems Administrator
Greatschools, Inc
http://www.greatschools.net



More information about the Slony1-general mailing list