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 12A50D1B182 for ; Tue, 20 Jul 2004 10:11:35 -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 82790-10 for ; Tue, 20 Jul 2004 13:11:29 +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 267CFD1B16A for ; Tue, 20 Jul 2004 10:11:25 -0300 (ADT) Received: from modem-2357.leopard.dialup.pol.co.uk ([217.135.153.53] helo=[192.168.0.100]) by cmailm4.svr.pol.co.uk with esmtp (Exim 4.14) id 1BmuP1-0005F5-VH; Tue, 20 Jul 2004 14:11:28 +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: <7787.1090327914@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> <1090324635.28049.2554.camel@stromboli> <7787.1090327914@sss.pgh.pa.us> Content-Type: text/plain Organization: 2nd Quadrant Message-Id: <1090329086.28049.2708.camel@stromboli> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-7) Date: Tue, 20 Jul 2004 14:11:27 +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/1026 X-Sequence-Number: 56587 On Tue, 2004-07-20 at 13:51, Tom Lane wrote: > Simon Riggs writes: > >> The quick and dirty solution would be to dike out the safety check at > >> 4268ff. > > > If you take out that check, we still fail because the wasted space at > > the end is causing a "record with zero length" error. > > Ugh. I'm beginning to think we ought to revert the patch that added the > don't-split-across-files logic to XLogInsert; that seems to have broken > more assumptions than I realized. That was added here: > > 2004-02-11 17:55 tgl > > * src/: backend/access/transam/xact.c, > backend/access/transam/xlog.c, backend/access/transam/xlogutils.c, > backend/storage/smgr/md.c, backend/storage/smgr/smgr.c, > bin/pg_controldata/pg_controldata.c, > bin/pg_resetxlog/pg_resetxlog.c, include/access/xact.h, > include/access/xlog.h, include/access/xlogutils.h, > include/pg_config_manual.h, include/catalog/pg_control.h, > include/storage/smgr.h: Commit the reasonably uncontroversial parts > of J.R. Nield's PITR patch, to wit: Add a header record to each WAL > segment file so that it can be reliably identified. Avoid > splitting WAL records across segment files (this is not strictly > necessary, but makes it simpler to incorporate the header records). > Make WAL entries for file creation, deletion, and truncation (as > foreseen but never implemented by Vadim). Also, add support for > making XLOG_SEG_SIZE configurable at compile time, similarly to > BLCKSZ. Fix a couple bugs I introduced in WAL replay during recent > smgr API changes. initdb is forced due to changes in pg_control > contents. > > There are other ways to do this, for example we could treat the WAL page > headers as variable-size, and stick the file labeling info into the > first page's header instead of making it be a separate record. The > separate-record way makes it easier to incorporate future additions to > the file labeling info, but I don't really think it's critical to allow > for that. > I think I've fixed it now...but wait 20 The problem was that a zero length XLOG_WASTED_SPACE record just fell out of ReadRecord when it shouldn't have. By giving it a helping hand it makes it through with pointers correctly set, and everything else was already thought of in the earlier patch, so xlog_redo etc happens. I'll update again in a few minutes....no point us both looking at this. Best regards, Simon Riggs