X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3185CD1B23E for ; Tue, 20 Jul 2004 08:57:19 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 52503-03 for ; Tue, 20 Jul 2004 11:57:19 +0000 (GMT) Received: from cmailm4.svr.pol.co.uk (cmailm4.svr.pol.co.uk [195.92.193.211]) by svr1.postgresql.org (Postfix) with ESMTP id 6FF00D1B1B3 for ; Tue, 20 Jul 2004 08:57:15 -0300 (ADT) Received: from modem-1848.lion.dialup.pol.co.uk ([217.135.167.56] helo=[192.168.0.100]) by cmailm4.svr.pol.co.uk with esmtp (Exim 4.14) id 1BmtFE-0002jS-OB; Tue, 20 Jul 2004 12:57:16 +0100 Subject: Re: PITR COPY Failure (was Point in Time Recovery) From: Simon Riggs To: Tom Lane Cc: Mark Kirkwood , pgsql-hackers@postgresql.org In-Reply-To: <3607.1090296869@sss.pgh.pa.us> References: <200407141555.i6EFtnk22984@mail.osdl.org> <1089833620.17493.4624.camel@stromboli> <40F5E14A.4090003@coretech.co.nz> <1089875702.17493.5539.camel@stromboli> <40F652C6.4070007@coretech.co.nz> <1089935215.17493.6906.camel@stromboli> <40FA0F93.8010607@coretech.co.nz> <40FC6BF2.5050701@coretech.co.nz> <3607.1090296869@sss.pgh.pa.us> Content-Type: text/plain Organization: 2nd Quadrant Message-Id: <1090324635.28049.2554.camel@stromboli> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-7) Date: Tue, 20 Jul 2004 12:57:16 +0100 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200407/1023 X-Sequence-Number: 56584 On Tue, 2004-07-20 at 05:14, Tom Lane wrote: > Mark Kirkwood writes: > > I have been doing some re-testing with CVS HEAD from about 1 hour ago > > using the simplified example posted previously. > > > It is quite interesting: > > The problem seems to be that the computation of checkPoint.redo at > xlog.c lines 4162-4169 (all line numbers are per CVS tip) is not > allowing for the possibility that XLogInsert will decide it doesn't > want to split the checkpoint record across XLOG files, and will then > insert a WASTED_SPACE record to avoid that (see comment and following > code at lines 758-795). This wouldn't really matter except that there > is a safety crosscheck at line 4268 that tries to detect unexpected > insertions of other records during a shutdown checkpoint. > > I think the code in CreateCheckPoint was correct when it was written, > because we only recently changed XLogInsert to not split records > across files. But it's got a boundary-case bug now, which your test > scenario is able to exercise by making the recovery run try to write > a shutdown checkpoint exactly at the end of a WAL file segment. > > The quick and dirty solution would be to dike out the safety check at > 4268ff. Well, taking out the safety check isn't the answer. The check produces the last error message "concurrent transaction...", but it isn't the cause of the mismatch in the first place. If you take out that check, we still fail because the wasted space at the end is causing a "record with zero length" error. > I'm not real sure whether it's better to adjust > the computation of checkPoint.redo or to smarten the safety check > ... but one or the other needs to allow for file-end padding, or maybe > we could hack some update of the state in WasteXLInsertBuffer(). (But > at some point you have to say "this is more trouble than it's worth", > so maybe we'll end up taking out the safety check.) ...I'm looking at other options now. Best Regards, Simon Riggs