Re: New trigger option of pg_standby

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Guillaume Smet <guillaume(dot)smet(at)gmail(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(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-13 03:44:49
Message-ID: 3f0b79eb0904122044j47583097j58151aad80955de9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Fri, Apr 10, 2009 at 6:31 PM, Guillaume Smet
<guillaume(dot)smet(at)gmail(dot)com> wrote:
> On Fri, Apr 10, 2009 at 5:47 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>> One idea to solve this problem is to tell pg_standby as a
>> command-line argument about whether the trigger file can be
>> removed. That parameter value can be set to 'true' when the last
>> applied record is re-fetched. Though pg_standby is called to
>> restore timeline history files also after that point, the trigger file
>> is already unnecessary (pg_standby doesn't wait for history file).
>>
>> Specifically, if restore_command contains new % option (%e?),
>> it's replaced by the boolean value which indicates whether the
>> trigger file can be deleted. This value is set to 'true' when the
>> startup process re-fetches the last valid record, 'false' otherwise.
>> In smart mode, pg_standby determines whether to delete the
>> trigger file according to that value.
>>
>> Comments?
>
> Hmmm, it seems overly complicated but I don't know the code of pg_standby.

Yes, I'd also like to simplify it more.

>> Or, do you have any better idea?
>
> Wouldn't it be possible to have a global switch (let's name it
> startCluster, default to false) which is set to true when the trigger
> file is found for the first time? You would then be able to remove the
> trigger file and let the cluster start by checking this variable.
>
> One more time, I don't know the code of pg_standby so it may be a stupid idea.

Thanks for the suggestion!

Since pg_standby is executed for each file, such variable cannot
be taken over to the next execution, i.e. it's reset each time. So,
the current patch have left the trigger file until the end.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Abhijit Menon-Sen 2009-04-13 03:48:38 Re: [PATCH] Add a test for pg_get_functiondef()
Previous Message Abhijit Menon-Sen 2009-04-13 03:39:02 [PATCH] Add a test for pg_get_functiondef()