Wed Jun 25 10:59:12 PDT 2008
- Previous message: [Slony1-general] Re: Slony1-general Digest, Vol 16, Issue 27
- Next message: [Slony1-general] Re: Slony1-general Digest, Vol 16, Issue 27
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Troy Wolf" <troy at troywolf.com> writes: >>> If, like the user in the link you provided, you are trying to >>> SUBSCRIBE, then use WAIT FOR EVENT to know when the SUBSCRIBE has >>> completed, then your problem is that this does not work. WAIT FOR >>> EVENT is unable to reliably know when the subscribe has completed, and >>> you cannot MERGE SET until the SUBSCRIBE completes. >>> >>> You'll probably notice that if you wait long enough--usually a few >>> seconds depending on your data size--the MERGE will work. >> >> Correct on both counts. > > Then you do not have a problem. What I tried to convey is that you > cannot do WAIT FOR EVENT. To my knowledge, all you can do with a > subscribe is manually wait for it to finish. You can do this by > watching the logs and noticing when the subscribe completes. > Alternatively, you can do what I do--I have a script that does the > subscribe then pauses waiting for me to hit ENTER to continue with the > MERGE. I simply wait 10 seconds or so then hit ENTER. If the MERGE > fails, I just assume the subscribe is still in process and go back to > the code that prompts the user to wait and hit ENTER when ready for > the MERGE. If I were to automate this script, I'd probably catch the > MERGE failure, go into a wait, then try again. Each time it fails, I'd > double my wait. Perhaps fail 10 times before giving up with a fatal > error. We're trying to get things to a point where you *could* use WAIT FOR EVENT to validate that subscriptions have completed. (At least, as long as there wasn't some other failure; if there are 10 error conditions, in a complex distributed system, we can't always hope to catch them *all*!) You can't expect to WAIT FOR EVENT against the SUBSCRIBE_SET event; the process of subscription is spread across multiple events, and the event whose confirmation would *directly* indicate completion of the subscription isn't available within the slonik script. However, there *is* a way to WAIT FOR EVENT that you should be able to expect to work, and if it doesn't there's something buggy going on. You submit the subscription, but THEN you submit a SYNC event. *That* event has got to get processed *after* the subscription work is done. And you can wait on THAT. Thus: include <preamble.slonik>; # Pull in configuration # Get the subscription going 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 No doubt I should add this to the documentation :-). -- (format nil "~S@~S" "cbbrowne" "linuxfinances.info") http://cbbrowne.com/info/linux.html Rules of the Evil Overlord #155. "If I know of any heroes in the land, I will not under any circumstance kill their mentors, teachers, and/or best friends." <http://www.eviloverlord.com/>
- Previous message: [Slony1-general] Re: Slony1-general Digest, Vol 16, Issue 27
- Next message: [Slony1-general] Re: Slony1-general Digest, Vol 16, Issue 27
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-general mailing list