Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 7821C633369 for ; Thu, 14 May 2009 16:07:41 -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 53557-04-7 for ; Thu, 14 May 2009 16:07:40 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail129175.authsmtp.co.uk (outmail129175.authsmtp.co.uk [62.13.129.175]) by mail.postgresql.org (Postfix) with ESMTP id 3C16F635236 for ; Thu, 14 May 2009 16:07:39 -0300 (ADT) Received: from mail-c189.authsmtp.com (mail-c189.authsmtp.com [62.13.128.71]) by punt8.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id n4EJ7VYc047178; Thu, 14 May 2009 20:07:31 +0100 (BST) Received: from [192.168.0.2] (85-211-225-42.dyn.gotadsl.co.uk [85.211.225.42]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id n4EJ7Tkt011258; Thu, 14 May 2009 20:07:29 +0100 (BST) Subject: Re: New trigger option of pg_standby From: Simon Riggs To: Fujii Masao Cc: Heikki Linnakangas , Tom Lane , Guillaume Smet , Peter Eisentraut , Kevin Grittner , pgsql-hackers In-Reply-To: <3f0b79eb0905141149lf5cef92j538f490c86dfedf8@mail.gmail.com> References: <3f0b79eb0903242329j12865d55s348f5c873a956e71@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> <1242247404.3843.503.camel@ebony.2ndQuadrant> <1242315415.3843.526.camel@ebony.2ndQuadrant> <3f0b79eb0905141149lf5cef92j538f490c86dfedf8@mail.gmail.com> Content-Type: text/plain Date: Thu, 14 May 2009 20:10:04 +0100 Message-Id: <1242328204.3843.599.camel@ebony.2ndQuadrant> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 Content-Transfer-Encoding: 7bit X-Server-Quench: 787068a6-40ba-11de-bc7b-001f29070be2 X-AuthRoute: OCdxZQATClZOTQEd DAteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksacRtFaQFbYFhI HGQLW11EUl17WWR/ aQMfZQBDYEtPQQdo VVZNQE1QEQdtHhxP WBprKB4WLEFGeX9y YE4sXHVZXAp9fUF9 REYFE3ACZTUxdWEe BBVFJVBTIh5Kfh4T aFl/U3NfNGdJBC9q VzwTFhsSEA9kHWxz Tx5FMUgTTkkGBHY7 XwwDGjNnGkNNXyoE NAAvLFIWDS41 X-Authentic-SMTP: 61633235383639.kestrel.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/625 X-Sequence-Number: 138167 On Fri, 2009-05-15 at 03:49 +0900, Fujii Masao wrote: > Hi, > > On Fri, May 15, 2009 at 12:36 AM, Simon Riggs wrote: > > > > On Wed, 2009-05-13 at 21:43 +0100, Simon Riggs wrote: > >> 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) > > > > Implemented. > > > + ereport(signaled ? FATAL : WARNING, > > + (errmsg("recovery_end_command \"%s\": return code %d", > > + xlogRecoveryEndCmd, rc))); > > In fast failover case, pg_standby has to delete the trigger file immediately > if it's found. Otherwise, recovery may go wrong as I already described. > http://archives.postgresql.org/pgsql-hackers/2009-04/msg01139.php > > So, in fast mode, recovery_end_command would always fail to delete the > trigger file, and cause warning. This is odd behavior, I think. We should > change WARNING to DEBUG2 like RestoreArchivedFile() in the above code? Using rm -f would avoid the WARNING. I'd rather keep it at WARNING, since not sure what command I'll be running and what a non-zero rc means. -- Simon Riggs www.2ndQuadrant.com PostgreSQL Training, Services and Support