Steve Polyack korvus at comcast.net
Mon Aug 31 13:35:50 PDT 2009
Steve Polyack wrote:
> Hi
> I've recently been testing Slony-1 2.0.2 with PostgreSQL 8.3.7.  
> Replication works great, but I can't seem to get it to perform a 
> switchover.  Our typical switchover command set from Slony1-1.2 does 
> not work:
> node 1 admin conninfo=*
> node 2 admin conninfo=*
> node 3 admin conninfo=*
> lock set (id=1, origin=1);
> wait for event (origin=1, confirmed=2);
> move set (id=1, old origin=1, new origin=2);
> wait for event (origin=1, confirmed=2);
>
> Executing the above produces:
> <stdin>:3: Error: No admin conninfo provided for node -1
> <stdin>:5: Error: No admin conninfo provided for node -1
>
> Now, looking this up has led me to find that we now need to specify a 
> 'wait on=' option for the WAIT FOR EVENT commands.  However, after 
> adding these (wait on = 1), I get another error after issuing the script:
> $ slonik switch.slonik
> switch.slonik:6: Error: script did not generate any event on node 1
>
> The set is however locked on all nodes, so I'm unsure as to how this 
> did not generate any events on Node 1.  Any ideas?
>
> Thanks,
> Steve Polyack
>
If anyone cares, I was able to fix this by getting rid of the first 
"wait for event" command.  My switchover script now looks like this and 
works as expected:
 node 1 admin conninfo=* 
 node 2 admin conninfo=*
 node 3 admin conninfo=*
 lock set (id=1, origin=1);
 move set (id=1, old origin=1, new origin=2);
 wait for event (origin=1, confirmed=2, wait on=1);

Perhaps locking the set is no longer considered an event.  Regardless, 
the switchover documentation for Slony 2.0.2 
(http://slony.info/documentation/failover.html) lists neither of these 
two caveats.





More information about the Slony1-general mailing list