Re: New trigger option of pg_standby

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Guillaume Smet <guillaume(dot)smet(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: New trigger option of pg_standby
Date: 2009-04-09 12:47:46
Message-ID: 49DDEE72.6030803@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fujii Masao wrote:
> Hi,
>
> On Wed, Apr 8, 2009 at 6:56 AM, Guillaume Smet <guillaume(dot)smet(at)gmail(dot)com> wrote:
>> On Fri, Apr 3, 2009 at 5:42 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sam Mason 2009-04-09 12:59:37 Re: NaN support in NUMERIC data type
Previous Message Peter Eisentraut 2009-04-09 12:29:37 Re: Translation conventions