Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 21AE5634980 for ; Wed, 13 May 2009 17:41:01 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 48458-06 for ; Wed, 13 May 2009 17:40:58 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail128111.authsmtp.co.uk (outmail128111.authsmtp.co.uk [62.13.128.111]) by mail.postgresql.org (Postfix) with ESMTP id 1F69E634975 for ; Wed, 13 May 2009 17:40:57 -0300 (ADT) Received: from mail-c187.authsmtp.com (mail-c187.authsmtp.com [62.13.128.33]) by punt4.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id n4DKenmU073045; Wed, 13 May 2009 21:40:49 +0100 (BST) Received: from [192.168.0.2] (85-211-96-202.dyn.gotadsl.co.uk [85.211.96.202]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id n4DKelBX053586; Wed, 13 May 2009 21:40:48 +0100 (BST) Subject: Re: New trigger option of pg_standby From: Simon Riggs To: Heikki Linnakangas Cc: Tom Lane , Fujii Masao , Guillaume Smet , Peter Eisentraut , Kevin Grittner , pgsql-hackers In-Reply-To: <4A0B10C7.2040309@enterprisedb.com> References: <3f0b79eb0903242329j12865d55s348f5c873a956e71@mail.gmail.com> <1239381103.16396.30.camel@ebony.2ndQuadrant> <3f0b79eb0904122252t1f4c5860v919d199f399ccf72@mail.gmail.com> <3f0b79eb0904132241p18084914g792cb8e5ab3eebb3@mail.gmail.com> <3f0b79eb0904150101pb1c59a3ubb422867e8e6a944@mail.gmail.com> <49EE1E3F.9050307@enterprisedb.com> <3f0b79eb0904212209i7fbd8b68k71db1fef09c62751@mail.gmail.com> <49F01D79.8020805@enterprisedb.com> <3f0b79eb0904230515p751b5248n6ef96880617db055@mail.gmail.com> <4A095A39.3030100@enterprisedb.com> <3f0b79eb0905130127u3a3275b1w79f4d8cb729ded36@mail.gmail.com> <4A0A86D2.9080602@enterprisedb.com> <1985.1242234105@sss.pgh.pa.us> <4A0B10C7.2040309@enterprisedb.com> Content-Type: text/plain Date: Wed, 13 May 2009 21:43:24 +0100 Message-Id: <1242247404.3843.503.camel@ebony.2ndQuadrant> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 Content-Transfer-Encoding: 7bit X-Server-Quench: 578d8842-3ffe-11de-8156-001185d377ca X-AuthRoute: OCdxZQATClZOTQEd DAteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksacRtFaQZbYFhI HGQLW11EUlx7XWN/ bwMfZQBDYEtPQQxs TkpJQE1QEQdtHhxP WBpqKUwuBW1GfX11 bUAsXHdTXwp/ck4p SkZQF3AFMzE1dWEe BBVFfwJRdh5Kfh5E YlUrV3QKMjRJBC9q VzwTFhsSEA9kHWxz Tx5FMUgTTkkGBHY7 XwwDGjNnGkNNXyoE NAAvLFIWDS41 X-Authentic-SMTP: 61633235383639.squirrel.dmpriest.net.uk:1562/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system. 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: 200905/596 X-Sequence-Number: 138138 On Wed, 2009-05-13 at 21:26 +0300, Heikki Linnakangas wrote: > This whole thing can be considered to be a new feature. recovery.conf will contain a new optional parameter: recovery_end_command (string) This parameter specifies a shell command that will be executed once only at the end of recovery. This parameter is optional. The purpose of the recovery_end_command is to provide a mechanism for cleanup following replication or recovery. Any %r is replaced by the name of the file containing the last valid restart point. That is the earliest file that must be kept to allow a restore to be restartable, so this information can be used to truncate the archive to just the minimum required to support restart of the current restore. %r would only be used in a warm-standby configuration (see Section 24.4). Write %% to embed an actual % character in the command. recovery_end_command is performed *after* the UpdateControlFile() once the we are DB_IN_PRODUCTION. This behaviour ensures that a crash prior to the final checkpoint will continue to see the trigger file. Once we are safe, we can remove the trigger file safely. We also can now ignore any complexity surrounding whether WAL files are full or not, and whether WAL files were restored from the archive or from the local directory. Comments? -- Simon Riggs www.2ndQuadrant.com PostgreSQL Training, Services and Support