Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TgIo2-0003M6-7T for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Dec 2012 17:30:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TgIo1-0002bW-Mx for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Dec 2012 17:30:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TgIo0-0002aj-IN for pgsql-bugs@postgresql.org; Wed, 05 Dec 2012 17:30:44 +0000 Received: from moutng.kundenserver.de ([212.227.17.9]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TgInu-00057h-Lg for pgsql-bugs@postgresql.org; Wed, 05 Dec 2012 17:30:44 +0000 Received: from anarazel.de (p5DDC4F13.dip.t-dialin.net [93.220.79.19]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0LfYxF-1SrLyt3oXB-00ow4N; Wed, 05 Dec 2012 18:30:27 +0100 Received: by anarazel.de (Postfix, from userid 1000) id 165351C00E6; Wed, 5 Dec 2012 18:30:25 +0100 (CET) Date: Wed, 5 Dec 2012 18:30:25 +0100 From: Andres Freund To: Simon Riggs Cc: Tom Lane , Jeff Janes , Heikki Linnakangas , Noah Misch , Pg Bugs Subject: Re: PITR potentially broken in 9.2 Message-ID: <20121205173025.GD27424@awork2.anarazel.de> References: <20121205021537.GB9811@awork2.anarazel.de> <22653.1354674454@sss.pgh.pa.us> <20121205143314.GA6420@awork2.anarazel.de> <6461.1354723883@sss.pgh.pa.us> <20121205162421.GB20456@awork2.anarazel.de> <7015.1354725616@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Provags-ID: V02:K0:8xBm9xb0c5/P/iVeNZcG3PQROiXeILSgwGoPLwav3N8 I6RyCseQ6CejuhWjb5PjCZCPbwTIaveqOpnAlBgwp+MYyUzWzM UJdR6ui0kXkZZel1b7+mhKLWH43fdRIfKvGzswEYTNcJd03Kad d9r2J41TveUa08Vtrg/CZeEAZgeHy2w/8Fm29cZHg7vWpuQXIJ ZfShkF1NJjkeYGO/yuh+9iS5u1wnYWMvayoPrbkzlN2KqXrwnI 6vGFtspHWiVmVuStHZUmY+MUR4nit11fQ/Fg4IGVdqI6NojFCo EzwS1KRK+NbXTTomuZjtuoHR3+6NZ98GMyFg9kAIzIE0jMVZjW O6NU5y7LuSRxl601O1Vrz11asvOVLJSM0tuar17R5 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 2012-12-05 17:24:42 +0000, Simon Riggs wrote: > On 5 December 2012 17:17, Simon Riggs wrote: > > > The recovery target and the consistency point are in some ways in > > conflict. If the recovery target is before the consistency point there > > is no point in stopping there, whether or not we pause. What we should > > do is say "recovery target reached, yet recovery not yet consistent, > > continuing". > > So ISTM that we should make recoveryStopsHere() return false while we > > are inconsistent. Problems solved. I prefer the previous (fixed) behaviour where we error out if we reach a recovery target before we are consistent: /* * Complain if we did not roll forward far enough to render the backup * dump consistent. Note: it is indeed okay to look at the local variable * minRecoveryPoint here, even though ControlFile->minRecoveryPoint might * be further ahead --- ControlFile->minRecoveryPoint cannot have been * advanced beyond the WAL we processed. */ if (InRecovery && (XLByteLT(EndOfLog, minRecoveryPoint) || !XLogRecPtrIsInvalid(ControlFile->backupStartPoint))) { if (reachedStopPoint) { /* stopped because of stop request */ ereport(FATAL, (errmsg("requested recovery stop point is before consistent recovery point"))); } /* * Ran off end of WAL before reaching end-of-backup WAL record, or * minRecoveryPoint. That's usually a bad sign, indicating that you * tried to recover from an online backup but never called * pg_stop_backup(), or you didn't archive all the WAL up to that * point. However, this also happens in crash recovery, if the system * crashes while an online backup is in progress. We must not treat * that as an error, or the database will refuse to start up. */ if (InArchiveRecovery || ControlFile->backupEndRequired) { if (ControlFile->backupEndRequired) ereport(FATAL, (errmsg("WAL ends before end of online backup"), errhint("All WAL generated while online backup was taken must be available at recovery."))); else if (!XLogRecPtrIsInvalid(ControlFile->backupStartPoint)) ereport(FATAL, (errmsg("WAL ends before end of online backup"), errhint("Online backup started with pg_start_backup() must be ended with pg_stop_backup(), and all WAL up to that point must be available at recovery."))); else ereport(FATAL, (errmsg("WAL ends before consistent recovery point"))); } } Seems to be good enough to me. Once the pause logic is fixed obviously. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs