From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@2ndquadrant.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: Heikki Linnakangas <hlinnakangas@vmware.com>
Cc: Noah Misch <noah@leadboat.com>
Cc: Pg Bugs <pgsql-bugs@postgresql.org>
Subject: Re: PITR potentially broken in 9.2
Date: Wed, 05 Dec 2012 11:40:16 -0500
Message-ID: <7015.1354725616@sss.pgh.pa.us> (raw)
In-Reply-To: <20121205162421.GB20456@awork2.anarazel.de>
References: <CAMkU=1wC230iJ9OjJnO5jwP32iR-HtMNqDbXHLaPhudGCZ2x1Q@mail.gmail.com>
<7787.1354482169@sss.pgh.pa.us>
<CAMkU=1wo9+TvTy-w9UkSEgwc49kXuu=V=8cEdyaH8CBFyUVeww@mail.gmail.com>
<20516.1354666844@sss.pgh.pa.us>
<CAMkU=1zo2j7bVfPDSgaGRffdkoZW2hNCRztDd2hLQSy+eKcpVg@mail.gmail.com>
<20121205021537.GB9811@awork2.anarazel.de>
<22653.1354674454@sss.pgh.pa.us>
<CA+U5nMKOsUWKP++QH=0nMff27t-KbLTEz560CzXz_upn-k1LDQ@mail.gmail.com>
<20121205143314.GA6420@awork2.anarazel.de>
<6461.1354723883@sss.pgh.pa.us>
<20121205162421.GB20456@awork2.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Andres Freund <andres@2ndquadrant.com> writes:
> Basically the whole logical arround recoveryApply seems to be broken
> currently. Because if recoveryApply=false we currently don't pause at
> all because we jump out of the apply loop with the break.
Huh? That break is after the pause:
/*
* Have we reached our recovery target?
*/
if (recoveryStopsHere(record, &recoveryApply))
{
/*
* Pause only if users can connect to send a resume
* message
*/
if (recoveryPauseAtTarget && standbyState == STANDBY_SNAPSHOT_READY)
{
SetRecoveryPause(true);
recoveryPausesHere();
}
reachedStopPoint = true; /* see below */
recoveryContinue = false;
if (!recoveryApply)
break;
}
The point of recoveryApply is that the stop can be defined as occurring
either before or after the current WAL record. However, I do see your
point, which is that if the stop is defined to be after the current WAL
record then we probably should apply same before pausing. Otherwise
the pause is a bit useless since the user can't see the state he's being
asked to approve.
The real question here probably needs to be "what is the point of
recoveryPauseAtTarget in the first place?". I find it hard to envision
what's the point of pausing unless the user has an opportunity to
make a decision about whether to continue applying WAL. As Simon
mentioned, we seem to be lacking some infrastructure that would let
the user adjust the recovery_target parameters before resuming WAL
processing. But, assuming for the moment that our workaround for
that is "shutdown the server, adjust recovery.conf, and restart",
is the pause placed in a useful spot for that?
BTW, could we make this more convenient by letting recoveryPausesHere()
reread recovery.conf? Also, shouldn't the code re-evaluate
recoveryStopsHere() after that?
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, andres@2ndquadrant.com, simon@2ndquadrant.com, jeff.janes@gmail.com, hlinnakangas@vmware.com, noah@leadboat.com
Subject: Re: PITR potentially broken in 9.2
In-Reply-To: <7015.1354725616@sss.pgh.pa.us>
References: <CAMkU=1wC230iJ9OjJnO5jwP32iR-HtMNqDbXHLaPhudGCZ2x1Q@mail.gmail.com> <7787.1354482169@sss.pgh.pa.us> <CAMkU=1wo9+TvTy-w9UkSEgwc49kXuu=V=8cEdyaH8CBFyUVeww@mail.gmail.com> <20516.1354666844@sss.pgh.pa.us> <CAMkU=1zo2j7bVfPDSgaGRffdkoZW2hNCRztDd2hLQSy+eKcpVg@mail.gmail.com> <20121205021537.GB9811@awork2.anarazel.de> <22653.1354674454@sss.pgh.pa.us> <CA+U5nMKOsUWKP++QH=0nMff27t-KbLTEz560CzXz_upn-k1LDQ@mail.gmail.com> <20121205143314.GA6420@awork2.anarazel.de> <6461.1354723883@sss.pgh.pa.us> <20121205162421.GB20456@awork2.anarazel.de> <7015.1354725616@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox