Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 100A564FCEE for ; Mon, 15 Sep 2008 11:59:53 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 90046-06 for ; Mon, 15 Sep 2008 11:59:46 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail137139.authsmtp.co.uk (outmail137139.authsmtp.co.uk [62.13.137.139]) by postgresql.org (Postfix) with ESMTP id F06BB64FCE7 for ; Mon, 15 Sep 2008 11:59:45 -0300 (ADT) Received: from punt7.authsmtp.com (punt7.authsmtp.com [62.13.128.13]) by punt6.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id m8FExiIt069454 for ; Mon, 15 Sep 2008 15:59:44 +0100 (BST) Received: from mail-c187.authsmtp.com (mail-c187.authsmtp.com [62.13.128.33]) by punt7.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id m8FExgmB095079; Mon, 15 Sep 2008 15:59:42 +0100 (BST) Received: from [192.168.0.3] (85-211-98-178.dyn.gotadsl.co.uk [85.211.98.178]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id m8FExeVD068594; Mon, 15 Sep 2008 15:59:41 +0100 (BST) Subject: Re: rmgr hooks and contrib/rmgr_hook From: Simon Riggs To: Tom Lane Cc: Gregory Stark , Heikki Linnakangas , ITAGAKI Takahiro , pgsql-hackers@postgresql.org In-Reply-To: <25319.1221487473@sss.pgh.pa.us> References: <20080901121833.4A18.52131E4D@oss.ntt.co.jp> <1220345064.4371.275.camel@ebony.2ndQuadrant> <20080902174613.76B2.52131E4D@oss.ntt.co.jp> <1220348980.4371.316.camel@ebony.2ndQuadrant> <14451.1220369969@sss.pgh.pa.us> <1220372673.4371.465.camel@ebony.2ndQuadrant> <48CB72C8.1070700@enterprisedb.com> <1221470800.3913.1229.camel@ebony.2ndQuadrant> <87sks1oi4o.fsf@oxford.xeocode.com> <24006.1221483138@sss.pgh.pa.us> <1221485063.3913.1350.camel@ebony.2ndQuadrant> <25319.1221487473@sss.pgh.pa.us> Content-Type: text/plain Date: Mon, 15 Sep 2008 16:00:04 +0100 Message-Id: <1221490804.3913.1406.camel@ebony.2ndQuadrant> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 Content-Transfer-Encoding: 7bit X-Server-Quench: ecd05653-8336-11dd-8155-001185d377ca X-AuthRoute: OCdxZQATClZOTQEd DAteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksacxtFaQBbflxB HGQLW1xEUVh7XGp/ bwsfZQBDYEtPQQxi TklOSk1QEQdtHhxP WxZoJ1EnEXFGfnZ1 bEIsXHlfXQovJhJ9 R0hRFnAOZmRmdWEe BBRFfwJRdR5Kfh5E YlUrV3QKMjRJBC9q VzwTFhsSEA9kHWxP Rw4XZVIVRkUQVjc6 S1gJGjMzB0wPAD82 IAYRKlkbHy41 X-Authentic-SMTP: 61633235383639.squirrel.dmpriest.net.uk:1186/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: 200809/983 X-Sequence-Number: 124112 On Mon, 2008-09-15 at 10:04 -0400, Tom Lane wrote: > Simon Riggs writes: > > The version mismatch idea presumes that a code author would structure > > their code in two pieces: one to generate the WAL and one to read it. > > No, the version mismatch problem is that you might try to read the WAL > with a different version of the plugin than you wrote it with. Or maybe > with a completely unrelated plugin that was unfortunate enough to choose > the same rmgr ID. We can't afford to insert complete versioning > information into each WAL record, so it's going to be pretty difficult > to avoid this risk. I'm happy to include additional things into the patch, but I don't see anything to force rejection of the patch entirely, from what has been said. Bottom line is that any backup of Postgres needs to include plugin directories, otherwise parts of the application could stop working following restore. This patch doesn't change that. I proposed a registration scheme to avoid one of those problems. If a plugin changed its file format, it would clearly need to include a version test within it. It wouldn't be the fault of the plugin API if the plugin author didn't handle that. But if they can work out how to build an index AM and write WAL, I'm sure they can handle version management between software components and informative error messages if problems occur. And if they can't, they'll get a bad rep and nobody will use the plugin. Few ideas: * add the rmgr bms to the long header of each WAL file * change !RmgrIdIsValid() so that it causes FATAL by default. This then allows people to correct a mistake and retry. We provide an option to treat such errors as corrupt data and assume we have reached the end of WAL. -- Simon Riggs www.2ndQuadrant.com PostgreSQL Training, Services and Support