pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andy Shellam <andy@andycc.net>
To: Simon Riggs <simon@2ndquadrant.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: WAL recovery
Date: Thu, 23 Feb 2006 16:18:45 +0000
Message-ID: <43FDE065.6060307@andycc.net> (raw)
In-Reply-To: <1140704662.8759.121.camel@localhost.localdomain>
References: <43FC90C9.3090204@mailnetwork.co.uk>
	<1140704662.8759.121.camel@localhost.localdomain>

Hi Simon,

Many thanks for this suggestion - this sounds ideal actually.  My 
thoughts on this are, I would write a shell script that gets called for 
each file requested in the recovery.conf ...

a) If the log file requested exists, copy it and exit with 0 status
b) If the file doesn't exist, check if there is a "bring_online" flag 
file set in the log transfer area ...
... if so, exit with non-zero so the server can be bought online.
... if not, sleep for 5 or 10 minutes - within this time the next log 
may or may not have arrived
c) After 5 or 10 minutes, repeat at step b

So basically if I need the server bringing up, I can either manually 
touch bring_online in the log transfer folder and wait for the next 5/10 
minute update, or have my monitoring system automatically touch that 
file when the connection to the primary database is broken, and switch 
the database server DNS to the standby server.

Sounds good!?!

Cheers for the idea Simon, now to get coding...!

Andy

Simon Riggs wrote:
> On Wed, 2006-02-22 at 16:26 +0000, Andy Shellam wrote:
>
>   
>> Is this scenario possible - that you can keep rolling forward over log
>> files as long as necessary, or do you always have to start from a base
>> backup?  Nothing is changing on the spare, it's literally a sitting
>> duck.
>>     
>
> You'll need a restore_command that is a script that sits in a wait loop
> when the file it is asked for is not available yet, or other conditions
> have occurred such as notification of switchover (manually or
> otherwise). When those conditions occur the script should return a
> non-zero error condition.
>
> There should be no recovery_target* settings.
>
> Best Regards, Simon Riggs
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org
>
> !DSPAM:43fdc5ac12881700010740!
>
>
>   

-- 
the mail network - an alternative in a standardised world 	Andy Shellam
*the mail network (Server Support)*

0 845 838 0879   	Phone
www.mailnetwork.co.uk <http://www.mailnetwork.co.uk;   	Web
andy.shellam@mailnetwork.co.uk 
<mailto:andy.shellam@mailnetwork.co.uk>   	E-mail

Attachments:

logo_15p.gif (image/gif, 5.4K) download view image
phone.gif (image/gif, 1.1K) download view image
internet.gif (image/gif, 1.2K) download view image
email.gif (image/gif, 1.2K) download view image

view thread (7+ messages)  latest in thread

Message-ID: <43FDE065.6060307@andycc.net>
Permalink:  ../43FDE065.6060307@andycc.net/
Also on:    postgresql.org/message-id/43FDE065.6060307@andycc.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: andy@andycc.net, simon@2ndquadrant.com
  Subject: Re: WAL recovery
  In-Reply-To: <43FDE065.6060307@andycc.net>
  References: <43FC90C9.3090204@mailnetwork.co.uk> <1140704662.8759.121.camel@localhost.localdomain> <43FDE065.6060307@andycc.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox