Christopher Browne cbbrowne at ca.afilias.info
Tue Nov 23 08:19:50 PST 2010
Stuart Bishop <stuart at stuartbishop.net> writes:
> On Fri, Nov 19, 2010 at 9:44 PM, Vick Khera <vivek at khera.org> wrote:
>> On Fri, Nov 19, 2010 at 4:28 AM, Stuart Bishop <stuart at stuartbishop.net> wrote:
>>>> That suggests to me there being some value to having some sort of "fail
>>>> if not sufficiently up to date" command.
>>>
>>> Pretty much all my canned scripts start by issuing a sync and waiting
>>> for it. I think it is dangerous to do otherwise. Failing with a
>>> meaningful error rather than leaving sysadmins staring at a blinking
>>> prompt would be preferable.
>>
>> Nice. What does this look like in the script?
>
> echo 'Waiting for cluster to sync. If this blocks, check for long
> running transactions and working slon daemons.';
> SYNC (id=@master_node);
> WAIT FOR EVENT (origin=@master_node, wait on=@master_node, confirmed=ALL);
> echo 'Synced.';

Hmm.  That would be nicely enhanced by some form of 
 ABORT( some specified cluster condition );

If things are up to date, you can continue, but terminate cleanly,
early, if things aren't up to date.

  <http://wiki.postgresql.org/wiki/SlonyToDo#ABORT>
-- 
(reverse (concatenate 'string "ofni.sailifa" "@" "enworbbc"))
Christopher Browne
"Bother,"  said Pooh,  "Eeyore, ready  two photon  torpedoes  and lock
phasers on the Heffalump, Piglet, meet me in transporter room three"


More information about the Slony1-general mailing list