[prev in list] [next in list] [prev in thread] [next in thread] 

List:       slony1-general
Subject:    RE: [Slony1-general] Move sets and "wait for event"
From:       "David Parker" <dparker () tazznetworks ! com>
Date:       2004-11-30 21:03:21
Message-ID: 07FDEE0ED7455A48AC42AC2070EDFF7C26BF66 () corpsrv2 ! tazznetworks ! com
[Download RAW message or body]

I believe the WAIT FOR EVENT can only be used outside of a transaction,
e.g., outside of a slonik "try" block.

- DAP 

>-----Original Message-----
>From: slony1-general-bounces@gborg.postgresql.org 
>[mailto:slony1-general-bounces@gborg.postgresql.org] On Behalf 
>Of Tim Goodaire
>Sent: Tuesday, November 30, 2004 3:59 PM
>To: slony1-general@gborg.postgresql.org
>Subject: [Slony1-general] Move sets and "wait for event"
>
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Hello everyone,
>
>I have a quick question about moving sets and wait for event. 
>If I have a slonik script to move set like this:
>
>try {
>~        echo 'Moving set 1 to node 3';
>~        lock set (id=1, origin=1);
>~        echo 'Set locked';
>~        wait for event (origin = 1, confirmed = 3);
>~        echo 'Moving set';
>~        move set (id=1, old origin=1, new origin=3);
>~        echo 'Set moved - waiting for event to be confirmed 
>by node 3';
>~        wait for event (origin = 1, confirmed = 3);
>	echo 'Confirmed';
>} on error {
>~      echo 'Could not move set for cluster foo';
>~      unlock set (id=1, origin=1);
>~      exit -1;
>}
>
>I get this output:
><stdin>:7: Moving set 1 to node 3
><stdin>:10: Set locked
><stdin>:12: Moving set
><stdin>:14: Set moved - waiting for event to be confirmed by node 3
>
>
>And it hangs...
>
>I have managed to take the wait for event lines out of my 
>script and it successfully moves the set.
>
>So, I have two questions:
>
>1. Do I need the wait for event lines? I have seen some 
>examples that include them, and some that don't... The slony 
>wiki includes them in the example on the SlonyHandlingFailover 
>page, but the move_set.pl altperl script doesn't.
>
>2. What is wrong with the second wait for event line? Should 
>it be originating from node 3 now that it is the new origin 
>for the set?
>
>
>Thanks,
>
>Tim
>
>
>
>- --
>Tim Goodaire    416-673-4126    tgoodair@ca.afilias.info
>Database Administrator, Afilias Canada Corp.
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.2.5 (GNU/Linux)
>Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
>
>iD8DBQFBrN8eRI056rlRJ/YRArTQAJ90Ap2zOf+CXy9ZCOxzQN1ddfUC7ACeO2ev
>T3bKVgs6AFDuiNXIwSmRAPE=
>=G5uT
>-----END PGP SIGNATURE-----
>_______________________________________________
>Slony1-general mailing list
>Slony1-general@gborg.postgresql.org
>http://gborg.postgresql.org/mailman/listinfo/slony1-general
>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic