Re: Verified fix for Bug 4137

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Verified fix for Bug 4137
Date: 2008-05-09 14:52:16
Message-ID: 1210344736.4268.653.camel@ebony.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On Fri, 2008-05-09 at 15:37 +0100, Heikki Linnakangas wrote:
> Simon Riggs wrote:
> > if (restartWALFileName)
> > {
> > + /*
> > + * Don't do cleanup if the restartWALFileName provided
> > + * is later than the xlog file requested. This is an error
> > + * and we must not remove these files from archive.
> > + * This shouldn't happen, but better safe than sorry.
> > + */
> > + if (strcmp(restartWALFileName, nextWALFileName) > 0)
> > + return false;
> > +
> > strcpy(exclusiveCleanupFileName, restartWALFileName);
> > return true;
> > }
>
> I committed this sanity check into pg_standy, though it really shouldn't
> happen, but it just occurred to me that the most likely reason for that
> to happen is probably that the user has screwed up his restore_command
> line, mixing up the %p and %r arguments. Should we make that an error
> instead of just not doing the cleanup?

You can't explicitly throw a pgsql error in pg_standby, so the best we
can do is get the file requested if it exists. If the file is the wrong
one then recovery will throw the error. As long as we didn't delete
anything when that happens we can just correct the mistake and retry.

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

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2008-05-09 15:12:32 Re: New flex warnings
Previous Message Tom Lane 2008-05-09 14:48:35 Re: [GENERAL] pgbench not setting scale size correctly?