Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 4CA17632D40 for ; Tue, 21 Apr 2009 08:17:56 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 36279-04 for ; Tue, 21 Apr 2009 08:17:46 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og112.obsmtp.com (exprod7og112.obsmtp.com [64.18.2.177]) by mail.postgresql.org (Postfix) with SMTP id BC89762FBB4 for ; Tue, 21 Apr 2009 08:17:52 -0300 (ADT) Received: from source ([209.85.219.163]) by exprod7ob112.postini.com ([64.18.6.12]) with SMTP ID DSNKSe2rXquZUasRGDAq4hZgHo1GQg11wThA@postini.com; Tue, 21 Apr 2009 04:17:52 PDT Received: by mail-ew0-f163.google.com with SMTP id 7so1476547ewy.7 for ; Tue, 21 Apr 2009 04:17:50 -0700 (PDT) Received: by 10.210.139.15 with SMTP id m15mr4860972ebd.15.1240312670287; Tue, 21 Apr 2009 04:17:50 -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 7sm3603754eyg.54.2009.04.21.04.17.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 21 Apr 2009 04:17:49 -0700 (PDT) Message-ID: <49EDAB5B.5040400@enterprisedb.com> Date: Tue, 21 Apr 2009 14:17:47 +0300 From: Heikki Linnakangas Organization: EnterpriseDB User-Agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Simon Riggs CC: Fujii Masao , Guillaume Smet , Tom Lane , Peter Eisentraut , Kevin Grittner , pgsql-hackers Subject: Re: New trigger option of pg_standby References: <3f0b79eb0903242329j12865d55s348f5c873a956e71@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> <49EC3B01.6050509@enterprisedb.com> <3f0b79eb0904200354u41b54017u16dc73d021c03cdb@mail.gmail.com> <49EC8B06.3020204@enterprisedb.com> <1240311836.23905.206.camel@ebony.fara.com> In-Reply-To: <1240311836.23905.206.camel@ebony.fara.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/1065 X-Sequence-Number: 137168 Simon Riggs wrote: > On Mon, 2009-04-20 at 17:47 +0300, Heikki Linnakangas wrote: > >> At the end of archive recovery, the server always probes for the >> timeline by requesting history files until it fails to find one. That >> probing should remove the trigger file if it hasn't been removed by >> then. It's a bit coincidental to rely on that, but at least it's simple. >> The assumption we're making is that the server won't exit recovery >> before asking restore_command for a file that doesn't exist. > > If you really want to simplify this, then we should have a final_command > parameter for a command to be executed at the end of recovery. That > would make the change to pg_standby very simple and allow for a very > simple final_command also. That would make the logic similar to what we > do for aggregates: transition function and final function. > > We could call it restore_cleanup_command or something similar. Hmm, that might indeed be a cleaner interface. However, that throws the idea of backpatching out of the window, and will make it impossible to run a PG 8.4 pg_standby against a PG 8.3 server. Do we want to add the new parameter for 8.4 anyway? > I suspect this option will make you consider Fujii-san's patch in a > better light. :-) No, removing trigger file as soon as a non-existant file is requested still seems simpler than deleting it whenever a timeline history file is requested. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com