Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tg4Wf-0006tY-8A for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Dec 2012 02:15:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tg4We-0006Ac-Kq for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Dec 2012 02:15:52 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tg4Wd-00069x-WC for pgsql-bugs@postgresql.org; Wed, 05 Dec 2012 02:15:52 +0000 Received: from moutng.kundenserver.de ([212.227.126.187]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tg4WY-0004PE-Vu for pgsql-bugs@postgresql.org; Wed, 05 Dec 2012 02:15:50 +0000 Received: from anarazel.de (p5DDC6236.dip.t-dialin.net [93.220.98.54]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0LehOU-1Speke3ms2-00pldc; Wed, 05 Dec 2012 03:15:39 +0100 Received: by anarazel.de (Postfix, from userid 1000) id 2F21B1C0173; Wed, 5 Dec 2012 03:15:38 +0100 (CET) Date: Wed, 5 Dec 2012 03:15:38 +0100 From: Andres Freund To: Jeff Janes Cc: Tom Lane , Heikki Linnakangas , Noah Misch , Pg Bugs Subject: Re: PITR potentially broken in 9.2 Message-ID: <20121205021537.GB9811@awork2.anarazel.de> References: <241.1354117868@sss.pgh.pa.us> <14784.1354394848@sss.pgh.pa.us> <16296.1354399004@sss.pgh.pa.us> <7787.1354482169@sss.pgh.pa.us> <20516.1354666844@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="yrj/dFKFPuw6o+aM" Content-Disposition: inline In-Reply-To: X-Provags-ID: V02:K0:z1I5MIN5c148KSLogzfHghTrGejH8VGRGhT+gy8TcZC qbd5c3nmvQJiB+5y57cpKKW8kjRXUUJssgW50IGXaFiv3oXdKE TXP3FPciYQFIA7lSCVagz1UG16pmuC16Vb+RU965bvJQzq351l Btp7cAglfWG12jOzHM/5YaJ0VYglqnuBR7ZU28RmgAK7T5MNrK iJADYxeWffvuAm+hyLWvaHDbcjJHO5dC6hTVvuSaLnebMLPNcM aZPrR1vweHm/BScNJ3VPnzctmDu3uCI8BtoVxxLRHucdlhkFtR 6dSr7f/Y1SODRTxBiyelgbQ2L6Us5VaH/54u/avv3fCH2/zBUA sjLzIvBAfzGjeVBQYxURxewcZub/mSGcEVy9VBx0z 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 --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On 2012-12-04 18:05:15 -0800, Jeff Janes wrote: > On Tue, Dec 4, 2012 at 4:20 PM, Tom Lane wrote: > > Jeff Janes writes: > >> I've reproduced it again using the just-tagged 9.2.2, and uploaded a > >> 135MB tarball of the /tmp/data_slave2 and /tmp/archivedir to google > >> drive. The data directory contains the recovery.conf which is set to > >> end recovery between the two critical time points. > > > > Hmmm ... I can reproduce this with current 9.2 branch tip. However, > > more or less by accident I first tried it with a 9.2-branch postmaster > > from a couple weeks ago, and it works as expected with that: the log > > output looks like > > > > LOG: restored log file "00000001000000000000001B" from archive > > LOG: restored log file "00000001000000000000001C" from archive > > LOG: restored log file "00000001000000000000001D" from archive > > LOG: database system is ready to accept read only connections > > LOG: recovery stopping before commit of transaction 305610, time 2012-12-02 15:08:54.000131-08 > > LOG: recovery has paused > > HINT: Execute pg_xlog_replay_resume() to continue. > > > > and I can connect and do the pg_xlog_replay_resume() thing. > > But the key is, the database was not actually consistent at that > point, and so opening hot standby was a dangerous thing to do. > > The bug that allowed the database to open early (the original topic if > this email chain) was masking this secondary issue. > > > So apparently this is something we broke since Nov 18. Don't know what > > yet --- any thoughts? Also, I am still not seeing what the connection > > is to the original report against 9.1.6. > > The behavior that we both see in 9.2.2, where it waits for a > pg_xlog_replay_resume() that cannot be delivered because the database > is not yet open, is the same thing I'm seeing in 9.1.6. I'll see if I > can repeat it in 9.1.7 and post the tarball of the data directory. Could you check whether the attached patch fixes the behaviour? Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="fix-recovery-pause.path" diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 4118070..bd309fe 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -5786,7 +5786,8 @@ StartupXLOG(void) * Pause only if users can connect to send a resume * message */ - if (recoveryPauseAtTarget && standbyState == STANDBY_SNAPSHOT_READY) + if (recoveryPauseAtTarget && reachedConsistency + && standbyState == STANDBY_SNAPSHOT_READY) { SetRecoveryPause(true); recoveryPausesHere(); --yrj/dFKFPuw6o+aM Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs --yrj/dFKFPuw6o+aM--