Tue May 18 20:03:01 PDT 2010
- Previous message: [Slony1-hackers] Subscribe set question
- Next message: [Slony1-hackers] init.d script for CentOS
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 5/16/2010 9:41 PM, Steve Singer wrote: > I've been looking into the behaviour of subscribe set for something and I'm > a bit confused. > > I was under the impression that the proper way of subscribing to a set is > > subscribe set(id=1,provider=1,receiver=2); > wait for event(id=1, origin=1,confirmed=all); > sync(id=1); > wait for event(id=1, origin=1,confirmed=all); > > (The documentation uses this sequence > http://www.slony.info/documentation/addthings.html) > > I thought that the 'wait for event' after the subscribe was to ensure that > the sync happens after the enable subscription event has been generated. > The documentation (on the SUBSCRIBE SET page in the admin docs) says > > 'subscription involves two events; the SUBSCRIBE_SET, initiated from the > provider node, and an ENABLE_SUBSCRIPTION, which is initiated on the > subscriber node' > > which is consistent with why would need that first wait. The problem I am > having is that I don't think this is right. In 2.0.x, if I subscribe to a > set with no slons running I see both the SUBSCRIBE SET and the ENABLE > SUBSCRIPTION events in the sl_event table of the provider (and looking at > the code this makes sense). > > Looking at the code, I it seems that the SUBSCRIBE SET and the ENABLE > SUBSCRIPTION are both inserted into sl_event as part of the same > transaction. The ENABLE SUBSCRPTION get processed on the receiver but it > gets inserted into the event queue BEFORE slonik finishes with the > 'subscribe set' line. So why the need to do that first WAIT FOR? The documentation seems wrong. The ENABLE_SUBSCRPTION is generated on the origin. If the origin happens to be your data provider, then yes, both events are generated within the same transaction and the sync is obsolete. In the case of a cascaded subscribe however it is not. Jan > > Am I misunderstanding something or did the location where the ENABLE > SUBSCRIPTION event is created get changed and the documentation not get > updated? > > > Steve > > _______________________________________________ > Slony1-hackers mailing list > Slony1-hackers at lists.slony.info > http://lists.slony.info/mailman/listinfo/slony1-hackers -- Anyone who trades liberty for security deserves neither liberty nor security. -- Benjamin Franklin
- Previous message: [Slony1-hackers] Subscribe set question
- Next message: [Slony1-hackers] init.d script for CentOS
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-hackers mailing list