pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Fujii Masao <masao.fujii@gmail.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: Guillaume Smet <guillaume.smet@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Eisentraut <peter_e@gmx.net>
Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: New trigger option of pg_standby
Date: Tue, 21 Apr 2009 22:27:59 +0300
Message-ID: <49EE1E3F.9050307@enterprisedb.com> (raw)
In-Reply-To: <3f0b79eb0904150101pb1c59a3ubb422867e8e6a944@mail.gmail.com>
References: <3f0b79eb0903242329j12865d55s348f5c873a956e71@mail.gmail.com>
	<3f0b79eb0903311901h70520cc8u9c0f1d8f4193923b@mail.gmail.com>
	<3f0b79eb0904022042g35b8e3cah9432ff764e721a3@mail.gmail.com>
	<1d4e0c10904071456m735e3f67q123b87243d2f6f2a@mail.gmail.com>
	<3f0b79eb0904071817u5c32254ei61f7e68e54669d9e@mail.gmail.com>
	<49DDEE72.6030803@enterprisedb.com>
	<3f0b79eb0904092047w355e0b3ar527a9285b161ef91@mail.gmail.com>
	<1239381103.16396.30.camel@ebony.2ndQuadrant>
	<3f0b79eb0904122252t1f4c5860v919d199f399ccf72@mail.gmail.com>
	<3f0b79eb0904132241p18084914g792cb8e5ab3eebb3@mail.gmail.com>
	<3f0b79eb0904150101pb1c59a3ubb422867e8e6a944@mail.gmail.com>

Fujii Masao wrote:
> Hi,
> 
> On Tue, Apr 14, 2009 at 2:41 PM, Fujii Masao <masao.fujii@gmail.com> wrote:
>> I'd like to propose another simple idea; pg_standby deletes the
>> trigger file *whenever* the nextWALfile is a timeline history file.
>> A timeline history file is restored at the end of recovery, so it's
>> guaranteed that the trigger file is deleted whether nextWALfile
>> exists or not.
>>
>> A timeline history file is restored also at the beginning of
>> recovery, so the accidentally remaining trigger file is deleted
>> in early warm-standby as a side-effect of this idea.
> 
> Here is the revised patch as above.
> 
> If you notice something, please feel free to comment.

Ok, looking at this in more detail now. A couple of small things:

We mustn't remove the trigger file immediately even in fast mode. As 
noted elsewhere in this thread, we have the same bug in fast mode where 
pg_standby gets stuck if you copy WAL files directly into pg_xlog.

pg_standby should exit with code 0 only if the file is restore 
successfully. As the patch stands it also returns 0 when smart failover 
is done.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com



view thread (127+ messages)  latest in thread

Message-ID: <49EE1E3F.9050307@enterprisedb.com>
Permalink:  ../49EE1E3F.9050307@enterprisedb.com/
Also on:    postgresql.org/message-id/49EE1E3F.9050307@enterprisedb.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: heikki.linnakangas@enterprisedb.com, masao.fujii@gmail.com, simon@2ndquadrant.com, guillaume.smet@gmail.com, tgl@sss.pgh.pa.us, peter_e@gmx.net, Kevin.Grittner@wicourts.gov
  Subject: Re: New trigger option of pg_standby
  In-Reply-To: <49EE1E3F.9050307@enterprisedb.com>

* 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