Re: Getting to 8.3 beta1

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Getting to 8.3 beta1
Date: 2007-09-27 16:45:32
Message-ID: 1190911532.4194.127.camel@ebony.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 2007-09-27 at 12:26 -0400, Tom Lane wrote:
> I wrote:
> > Looking back at your original discussion of the bug,
> > http://archives.postgresql.org/pgsql-hackers/2007-06/msg00234.php
> > I'm wondering why you chose option #3 rather than option #4?
> > I still find the proposed patch a bit crufty.
>
> In particular, it seems like a patch per #4 would be a one-liner:
>
> *** src/backend/access/transam/xlog.c.orig Wed Sep 26 18:36:30 2007
> --- src/backend/access/transam/xlog.c Thu Sep 27 12:20:56 2007
> ***************
> *** 5092,5101 ****
> *
> * If we stopped short of the end of WAL during recovery, then we are
> * generating a new timeline and must assign it a unique new ID.
> * Otherwise, we can just extend the timeline we were in when we ran out
> * of WAL.
> */
> ! if (needNewTimeLine)
> {
> ThisTimeLineID = findNewestTimeLine(recoveryTargetTLI) + 1;
> ereport(LOG,
> --- 5092,5103 ----
> *
> * If we stopped short of the end of WAL during recovery, then we are
> * generating a new timeline and must assign it a unique new ID.
> + * We also force a new timeline when recovering from an archive, to avoid
> + * problems with trying to overwrite existing archived segments.
> * Otherwise, we can just extend the timeline we were in when we ran out
> * of WAL.
> */
> ! if (needNewTimeLine || (InArchiveRecovery && XLogArchivingActive()))
> {
> ThisTimeLineID = findNewestTimeLine(recoveryTargetTLI) + 1;
> ereport(LOG,

AFAICS the correct test would be

if (InArchiveRecovery)

since needNewTimeLine can only be true iff InArchiveRecovery is true.

It's often a good idea to disable archive_mode when doing a recovery to
avoid trying to send files to the same archive as the primary, which
would then also fail. So requiring XLogArchivingActive() also may not be
desirable.

--
Simon Riggs
2ndQuadrant http://www.2ndQuadrant.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-09-27 16:45:59 Re: Getting to 8.3 beta1
Previous Message Tom Lane 2007-09-27 16:44:25 Re: Getting to 8.3 beta1