Steve Singer ssinger at ca.afilias.info
Fri Oct 8 07:02:39 PDT 2010
On 10-10-07 06:21 PM, Brian Hirt wrote:
>
> So I was following the documentation at http://www.slony.info/documentation/2.0/failover.html and couldn't figure out why i couldn't switch over.   I kept getting an error about node -1. I found http://www.slony.info/documentation/2.0/stmtwaitevent.html which says "In version 2.0, the default value for WAIT ON was removed, so a node must be specified."  Adding wait on solved the
> problem.

Thanks I've committed a change to the documentation to address this.

I put the example as "wait on=1" but "wait on=2" will work as well. 
With waiting on 2 you will wait only wait until node 2 (the new origin) 
has processed the move set.  With "wait on=1" you will wait until the 
confirmation has flowed from node 2 to node 1.


>
> Something else I noticed is that tools/altperl/slonik_move_set.pl does this with slightly different commands, it does:
>
> lock set (id = 1, origin = 1);
> sync (id = 1);
> wait for event (origin = 1, confirmed = 2, wait on = 2);
> move set (id = 1, old origin = 1, new origin = 2);
>
> whereas the example in the documentation does:
>
> lock set (id = 1, origin = 1);
> move set (id = 1, old origin = 1, new origin = 2);
> wait for event (origin = 1, confirmed = 2);
>
> I'm not sure if sync() is required, but I'm using sync() in my scripts, it seems to make sense.  I'm also doing a wait for event after the move set.   Something else that might be helpful is showing how to switch back.  It's not immediately obvious which node ids should be used for the wait for event commands.  I think the opposite would be:


I don't think the sync is required after the lock set.

What we might want to consider is

move set (id = 1, old origin = 1, new origin = 2);
wait for event (origin = 1, confirmed = 2, wait on=2);
sync(id=2)
wait for event(origin=2,confirmed=all,wait on=2);

once the 'move set' has been confirmed on the new origin it means that 
the new origin knows that is now the origin and will start accepting 
updates.   The other nodes in the system won't yet know that the origin 
has changed.  As part of processing the move set on the new origin the 
new origin will post an ACCEPT_SET to everyone else.

It sort of depends what you want to do after the move set. If all you 
want to know is when is it safe to start applying traffic to the new 
origin then what is in the documentation is fine.  If you want to wait 
until all move set related activities are done then you need the extra 
sync/wait for combination.


>
> lock set (id = 1, origin = 2);
> sync (id = 2);
> wait for event (origin = 2, confirmed = 1, wait on = 1);
> move set (id = 1, old origin = 2, new origin = 1);
> wait for event (origin = 2, confirmed = 1);

This is fine to move things back (other than your missing the 'wait on' 
in the last wait for event.




>
> Thanks,
> Brian
> _______________________________________________
> Slony1-general mailing list
> Slony1-general at lists.slony.info
> http://lists.slony.info/mailman/listinfo/slony1-general



More information about the Slony1-general mailing list