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 7DE25D1B23E for ; Tue, 13 Jul 2004 17:25:55 -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 48848-05 for ; Tue, 13 Jul 2004 20:25:54 +0000 (GMT) Received: from cmailm1.svr.pol.co.uk (cmailm1.svr.pol.co.uk [195.92.193.18]) by svr1.postgresql.org (Postfix) with ESMTP id 5ACC5D1B1D9 for ; Tue, 13 Jul 2004 17:25:50 -0300 (ADT) Received: from modem-3845.llama.dialup.pol.co.uk ([217.135.191.5] helo=[192.168.0.100]) by cmailm1.svr.pol.co.uk with esmtp (Exim 4.14) id 1BkTqY-00039d-Qc; Tue, 13 Jul 2004 21:25:51 +0100 Subject: Re: Point in Time Recovery From: Simon Riggs To: Tom Lane Cc: pgsql-hackers@postgresql.org In-Reply-To: <15780.1089728984@sss.pgh.pa.us> References: <1089060299.17493.58.camel@stromboli> <4263.1089064016@sss.pgh.pa.us> <1089150005.17493.270.camel@stromboli> <1089718702.17493.2527.camel@stromboli> <15780.1089728984@sss.pgh.pa.us> Content-Type: text/plain Organization: 2nd Quadrant Message-Id: <1089750349.17493.3092.camel@stromboli> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-7) Date: Tue, 13 Jul 2004 21:25:50 +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/698 X-Sequence-Number: 56259 On Tue, 2004-07-13 at 15:29, Tom Lane wrote: > Simon Riggs writes: > > Please tell me that we can ignore the state of the clog, > > We can. > In general, you are of course correct. > The reason that keeping track of timelines is interesting for xlog is > simply to take pity on the poor DBA who needs to distinguish the various > archived xlog files he's got laying about, and so that we can detect > errors like supplying inconsistent sets of xlog segments during restore. > > This does not apply to clog because it's not archived. It's no more > than a data file. If you think you have trouble recreating clog then > you have the same issues recreating data files. I'm getting carried away with the improbable....but this is the rather strange, but possible scenario I foresee: A sequence of times... 1. We start archiving xlogs 2. We take a checkpoint 3. we commit an important transaction 4. We take a backup 5. We take a checkpoint As stands currently, when we restore the backup, controlfile says that last checkpoint was at 2, so we rollforward from 2 THRU 4 and continue on past 5 until end of logs. Normally, end of logs isn't until after 4... When we specify a recovery target, it is possible to specify the rollforward to complete just before point 3. So we use the backup taken at 4 to rollforward to a point in the past (from the backups perspective). The backup taken at 4 may now have data and clog records written by bgwriter. Given that time between checkpoints is likely to be longer than previously was the case...this becomes a non-zero situation. I was trying to solve this problem head on, but the best way is to make sure we never allow ourselves such a muddled situation: ISTM the way to avoid this is to insist that we always rollforward through at least one checkpoint to guarantee that this will not occur. ...then I can forget I ever mentioned the ****** clog again. I'm ignoring this issue for now....whether it exists or not! Best Regards, Simon Riggs