Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 7BDA663EE43 for ; Mon, 20 Apr 2009 07:37:00 -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 21882-03-2 for ; Mon, 20 Apr 2009 07:37:14 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og102.obsmtp.com (exprod7og102.obsmtp.com [64.18.2.157]) by mail.postgresql.org (Postfix) with SMTP id E33F063EA2E for ; Mon, 20 Apr 2009 06:06:14 -0300 (ADT) Received: from source ([209.85.219.164]) by exprod7ob102.postini.com ([64.18.6.12]) with SMTP ID DSNKSew7BSq01SH998ELTugwTK2E4oEThK4X@postini.com; Mon, 20 Apr 2009 02:06:15 PDT Received: by mail-ew0-f164.google.com with SMTP id 8so1768205ewy.38 for ; Mon, 20 Apr 2009 02:06:13 -0700 (PDT) Received: by 10.210.33.3 with SMTP id g3mr5539487ebg.82.1240218373159; Mon, 20 Apr 2009 02:06:13 -0700 (PDT) Received: from ?80.223.212.7? (dsl-hkibrasgw2-fed4df00-7.dhcp.inet.fi [80.223.212.7]) by mx.google.com with ESMTPS id 10sm1494881eyd.2.2009.04.20.02.06.10 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 20 Apr 2009 02:06:11 -0700 (PDT) Message-ID: <49EC3B01.6050509@enterprisedb.com> Date: Mon, 20 Apr 2009 12:06:09 +0300 From: Heikki Linnakangas Organization: EnterpriseDB User-Agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Fujii Masao CC: Simon Riggs , Guillaume Smet , Tom Lane , Peter Eisentraut , Kevin Grittner , pgsql-hackers Subject: Re: New trigger option of pg_standby 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> In-Reply-To: <3f0b79eb0904150101pb1c59a3ubb422867e8e6a944@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200904/1023 X-Sequence-Number: 137126 Fujii Masao wrote: > On Tue, Apr 14, 2009 at 2:41 PM, Fujii Masao 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. I think we have gone off to an overly complicated solution. pg_standby shouldn't need to special-case history files, or know what order the server will ask for them. What's wrong with just this: (ignoring the missing fast option) --- a/contrib/pg_standby/pg_standby.c +++ b/contrib/pg_standby/pg_standby.c @@ -552,8 +552,6 @@ main(int argc, char **argv) break; case 't': /* Trigger file */ triggerPath = optarg; - if (CheckForExternalTrigger()) - exit(1); /* Normal exit, with non-zero */ break; case 'w': /* Max wait time */ maxwaittime = atoi(optarg); ie. only check and delete the trigger file once the server requests a file that doesn't exist. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com