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: Guillaume Smet <guillaume.smet@gmail.com>
Cc: Simon Riggs <simon@2ndquadrant.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: Thu, 09 Apr 2009 15:47:46 +0300
Message-ID: <49DDEE72.6030803@enterprisedb.com> (raw)
In-Reply-To: <3f0b79eb0904071817u5c32254ei61f7e68e54669d9e@mail.gmail.com>
References: <3f0b79eb0903242329j12865d55s348f5c873a956e71@mail.gmail.com>
	<3f0b79eb0903251851v5936d6b4x49997ac8f04b98b9@mail.gmail.com>
	<1d4e0c10903260032v767da1fdg6cf7cea86c64cc45@mail.gmail.com>
	<1238064633.16568.420.camel@ebony.2ndQuadrant>
	<49CCBEE0.1080307@gmx.net>
	<8365.1238163943@sss.pgh.pa.us>
	<1238164596.16568.604.camel@ebony.2ndQuadrant>
	<3f0b79eb0903311901h70520cc8u9c0f1d8f4193923b@mail.gmail.com>
	<3f0b79eb0904022042g35b8e3cah9432ff764e721a3@mail.gmail.com>
	<1d4e0c10904071456m735e3f67q123b87243d2f6f2a@mail.gmail.com>
	<3f0b79eb0904071817u5c32254ei61f7e68e54669d9e@mail.gmail.com>

Fujii Masao wrote:
> Hi,
> 
> On Wed, Apr 8, 2009 at 6:56 AM, Guillaume Smet <guillaume.smet@gmail.com> wrote:
>> On Fri, Apr 3, 2009 at 5:42 AM, Fujii Masao <masao.fujii@gmail.com> wrote:
>>> Here is the patch;
>>> - Smart failover is chosen if the trigger file labeled "smart" or
>>>  an empty one exists.
>>> - Fast failover is chosen if the trigger file labeled "fast" exists,
>>>  the signal (SIGUSR1 or SIGINT) is received or the wait timeout
>>>  happens.
>> After some further thoughts, +1 for this approach too.
>>
>> I think you imply 'containing "smart"' not 'labeled "smart"'.
>> "Labeled" is confusing IMHO.
> 
> Thanks for the comment!
> I corrected such confusing expression.

> + 	if (strspn(buf, "smart") == 5 && strncmp(buf, "smart", 5) == 0)
> + 	{

The strspn() call seems pointless here.

One problem with this patch is that in smart mode, the trigger file is 
not deleted. That's different from current pg_standby behavior, and 
makes accidental failovers after one failover more likely.

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



view thread (127+ messages)  latest in thread

Message-ID: <49DDEE72.6030803@enterprisedb.com>
Permalink:  ../49DDEE72.6030803@enterprisedb.com/
Also on:    postgresql.org/message-id/49DDEE72.6030803@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, guillaume.smet@gmail.com, simon@2ndquadrant.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: <49DDEE72.6030803@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