Christopher Browne cbbrowne at ca.afilias.info
Fri Jun 27 10:53:04 PDT 2008
"Alexander Staubo" <alex at bengler.no> writes:
> On Fri, Jun 27, 2008 at 4:03 PM, Troy Wolf <troy at troywolf.com> wrote:
>> Alexander (and others), I tested this and it works perfectly. Thanks,
>> Chris Browne. I know a lot of people use PERL scripts, etc. I use
>> "simple" bash shell scripts with the slonik commands. Here is a
>> snippet of my subscribe code. I have my common slonik preamble stuff
>> in a file named slonik_preamble.txt. I hope this helps you, Alexander:
>
> All right, I tried a different tack, and finally discovered the cause
> of my problem: I was not executing "sync" and "wait for event" in the
> same Slonik script; instead, I was issuing the sync first and then the
> wait in a second Slonik call.
>
> Perhaps there is a rational explanation for this behaviour, but to a
> Slony newbie such as myself, this is not obvious.

Ah, that would explain it; if you don't submit them in the same
request, the WAIT FOR EVENT has no way to know what event to wait for.

> The reason I have been doing it in separate scripts is that I generate
> the scripts dynamically through a set of wrappers, letting me easily
> decompose complex Slony operations into multiple high-level calls:
>
>   cluster.find_set(10000).drop!
>   set = cluster.find_set(1)
>   set.add_table!("contacts", :id => 16)
>   cluster.wait_for_event(:all, master, :wait_on => slave, :timeout =>
> 0, :sync => true)
>
> and so on. Having the calls map one-to-one with Slony commands makes
> the implementation simpler, but I guess I have to change this.

Unfortunately, 1-to-1 has some downsides :-(.

Some of the functionality requires grouping operations together.
-- 
output = ("cbbrowne" "@" "linuxfinances.info")
http://linuxdatabases.info/info/finances.html
"Here I  am, brain the  size of a planet, and  they ask me to take you
down the the bridge.  Call that job satisfaction?  'Cos I don't."
-- Marvin the Paranoid Android


More information about the Slony1-general mailing list