From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Jeff Davis <pgsql@j-davis.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Recovery bug
Date: Thu, 11 Nov 2010 18:20:20 +0200
Message-ID: <4CDC17C4.4060502@enterprisedb.com> (raw)
In-Reply-To: <1289434809.22581.99.camel@jdavis-ux.asterdata.local>
References: <1287183483.30681.54.camel@jdavis-ux.asterdata.local>
<1287355728.8516.383.camel@jdavis>
<4CBD6458.4050400@enterprisedb.com>
<1287507095.8516.547.camel@jdavis>
<1287517214.20345.5.camel@jdavis-ux.asterdata.local>
<4CC56DA5.3040908@enterprisedb.com>
<1288022672.8516.801.camel@jdavis>
<4CC687CB.6080306@enterprisedb.com>
<1289434809.22581.99.camel@jdavis-ux.asterdata.local>
On 11.11.2010 02:20, Jeff Davis wrote:
> There is a problem with this patch. ReadRecord() not only modifies
> global variables, it also modifies the location pointed to by "record",
> which is later used to set "wasShutdown". How about if we only set
> "wasShutdown" if there is no backup_label (because the checkpoint for
> pg_start_backup() will never be a shutdown checkpoint anyway)?
Oh, good catch.
> Trivial patch attached.
Hmm, you're assuming that the checkpoint specified in the backup label
is never a shutdown checkpoint. I guess that's true, but I'd rather do
this (patch attached).
(StartupXLOG is quite a mess...)
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.comAttachments:recovery-bug-3.patch (text/x-diff, 937B) downloaddiff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.cindex 786d0c6..c018d3b 100644--- a/src/backend/access/transam/xlog.c+++ b/src/backend/access/transam/xlog.c@@ -5846,6 +5846,7 @@ StartupXLOG(void)
if (record != NULL)
{
memcpy(&checkPoint, XLogRecGetData(record), sizeof(CheckPoint));
+ wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN);
ereport(DEBUG1,
(errmsg("checkpoint record is at %X/%X",
checkPointLoc.xlogid, checkPointLoc.xrecoff)));
@@ -5914,10 +5915,10 @@ StartupXLOG(void)
(errmsg("could not locate a valid checkpoint record")));
}
memcpy(&checkPoint, XLogRecGetData(record), sizeof(CheckPoint));
+ wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN);
}
LastRec = RecPtr = checkPointLoc;
- wasShutdown = (record->xl_info == XLOG_CHECKPOINT_SHUTDOWN);
ereport(DEBUG1,
(errmsg("redo record is at %X/%X; shutdown %s",
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: heikki.linnakangas@enterprisedb.com, pgsql@j-davis.com
Subject: Re: Recovery bug
In-Reply-To: <4CDC17C4.4060502@enterprisedb.com>
References: <1287183483.30681.54.camel@jdavis-ux.asterdata.local> <1287355728.8516.383.camel@jdavis> <4CBD6458.4050400@enterprisedb.com> <1287507095.8516.547.camel@jdavis> <1287517214.20345.5.camel@jdavis-ux.asterdata.local> <4CC56DA5.3040908@enterprisedb.com> <1288022672.8516.801.camel@jdavis> <4CC687CB.6080306@enterprisedb.com> <1289434809.22581.99.camel@jdavis-ux.asterdata.local> <4CDC17C4.4060502@enterprisedb.com>
* 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