Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 5550763434A for ; Fri, 10 Apr 2009 06:31:51 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 17875-03 for ; Fri, 10 Apr 2009 06:31:49 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f174.google.com (mail-fx0-f174.google.com [209.85.220.174]) by mail.postgresql.org (Postfix) with ESMTP id B1D2B6342D4 for ; Fri, 10 Apr 2009 06:31:49 -0300 (ADT) Received: by fxm22 with SMTP id 22so1836334fxm.19 for ; Fri, 10 Apr 2009 02:31:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=1Eo7/Spys+W2FEsooUpzOuRSwHO11POdHPXqsQwEkEk=; b=FC7lvqf6Tz/iIGL1qZyeB/b6n06i11hPrC0e+D66WgdpzMcgWx3i0clYb3OUR0bWfV 0+3t1k6kK/UZ3yYDh5OHkZq2u1fGsiY7Th0hFrOnTB25vOG83TmsGL4HR2fHwKHZOnR8 CFXjJq5E1lv2I8+AuCptxqyS2tjMiOvz38/+s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=eAFa5+veFJz6ajW990zrnJ2sBCZXchn0/bCuIztaIhQuMcnJvrxyvrz9U2q5IaVOD2 nBvCyfwy3tqcUSMe9PtSkwax34ECD+OaU8v14bj9V1CLxR2WvM/PXaEpdQ0fTrxEf2aM A7Sxih5uHkABGSQgjk80QxBztyrU/WoyZ0yjw= MIME-Version: 1.0 Received: by 10.223.110.211 with SMTP id o19mr1013208fap.57.1239355908085; Fri, 10 Apr 2009 02:31:48 -0700 (PDT) In-Reply-To: <3f0b79eb0904092047w355e0b3ar527a9285b161ef91@mail.gmail.com> References: <3f0b79eb0903242329j12865d55s348f5c873a956e71@mail.gmail.com> <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> <49DDEE72.6030803@enterprisedb.com> <3f0b79eb0904092047w355e0b3ar527a9285b161ef91@mail.gmail.com> Date: Fri, 10 Apr 2009 11:31:47 +0200 Message-ID: <1d4e0c10904100231p43aecd0fhdae48f732d9f264d@mail.gmail.com> Subject: Re: New trigger option of pg_standby From: Guillaume Smet To: Fujii Masao Cc: Heikki Linnakangas , Simon Riggs , Tom Lane , Peter Eisentraut , Kevin Grittner , pgsql-hackers Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200904/544 X-Sequence-Number: 136647 On Fri, Apr 10, 2009 at 5:47 AM, Fujii Masao 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. > 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. -- Guillaume