From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@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: Tue, 04 Dec 2012 21:27:34 -0500
Message-ID: <22653.1354674454@sss.pgh.pa.us> (raw)
In-Reply-To: <20121205021537.GB9811@awork2.anarazel.de>
References: <241.1354117868@sss.pgh.pa.us>
<CAMkU=1w17GKXFHgt8mUrfcP80Otbd9ye8uTufX-z_JFMD0nexQ@mail.gmail.com>
<14784.1354394848@sss.pgh.pa.us>
<CAMkU=1z+Tn46kftM7ptYM8-iqBvH6CrpTv5g=CCHO2zxOXuzvw@mail.gmail.com>
<16296.1354399004@sss.pgh.pa.us>
<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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Andres Freund <andres@2ndquadrant.com> writes:
>> 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.
> Could you check whether the attached patch fixes the behaviour?
Yeah, I had just come to the same conclusion: the bug is not with
Heikki's fix, but with the pause logic. The comment says that it
shouldn't pause unless users can connect to un-pause, but the actual
implementation of that test is several bricks shy of a load.
Your patch is better, but it's still missing a bet: what we need to be
sure of is not merely that we *could* have told the postmaster to start
hot standby, but that we *actually have done so*. Otherwise, it's
flow-of-control-dependent whether it works or not; we could fail if the
main loop hasn't gotten to CheckRecoveryConsistency since the conditions
became true. Looking at the code in CheckRecoveryConsistency, testing
LocalHotStandbyActive seems appropriate.
I also thought it was pretty dangerous that this absolutely critical
test was not placed in recoveryPausesHere() itself, rather than relying
on the call sites to remember to do it.
So the upshot is that I propose a patch more like the attached.
This is not a regression because the pause logic is broken this same
way since 9.1. So I no longer think that we need a rewrap.
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, jeff.janes@gmail.com, hlinnakangas@vmware.com, noah@leadboat.com
Subject: Re: PITR potentially broken in 9.2
In-Reply-To: <22653.1354674454@sss.pgh.pa.us>
References: <241.1354117868@sss.pgh.pa.us> <CAMkU=1w17GKXFHgt8mUrfcP80Otbd9ye8uTufX-z_JFMD0nexQ@mail.gmail.com> <14784.1354394848@sss.pgh.pa.us> <CAMkU=1z+Tn46kftM7ptYM8-iqBvH6CrpTv5g=CCHO2zxOXuzvw@mail.gmail.com> <16296.1354399004@sss.pgh.pa.us> <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>
* 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