Re: Recovery target 'immediate'

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Simon Riggs <simon(at)2ndquadrant(dot)com>
Subject: Re: Recovery target 'immediate'
Date: 2013-04-26 14:54:38
Message-ID: CABUevEwiuVrxHeYDDVUqTLQjujuj_i9zRyKDCrcVBGyDNp_rrw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Apr 26, 2013 4:38 PM, "Robert Haas" <robertmhaas(at)gmail(dot)com> wrote:
>
> On Fri, Apr 26, 2013 at 10:05 AM, Simon Riggs <simon(at)2ndquadrant(dot)com>
wrote:
> > Restore points are definitely the way to go here, this is what they
> > were created for. Stopping at a labelled location has a defined
> > meaning for the user, which is much better than just "stop anywhere
> > convenient", which I found so frightening.
> >
> > It should be straightforward to create a restore point with the same
> > name as used in pg_start_backup('text');
> >
> > pg_basebackup backups would need to use a unique key, which is harder
> > to achieve. If we write a WAL record at backup start that would make
> > the starting LSN unique, so we could then use that for the restore
> > point name for that backup.
> >
> > If people want anything else they can request an additional restore
> > point at the end of the backup.
>
> I personally find this to be considerably more error-prone than
> Heikki's suggestion. On the occasions when I have had the dubious
> pleasure of trying to do PITR recovery, it's quite easy to supply a
> recovery target that never actually gets matched - and then you
> accidentally recover all the way to the end of WAL. This is not fun.
> Having a bulletproof way to say "recover until you reach consistency
> and then stop" is a much nicer API. I don't think "stop as soon as
> possible" is at all the same thing as "stop anywhere convenient".
>

Thinking some more about it, this could also be useful together with
pausing at the recovery target to get a quick look at the state of things
before recovering further. I assume that would work as well, since it would
be "a recovery target like the others"..

/Magnus

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-04-26 15:22:27 Re: libpq COPY handling
Previous Message Tom Lane 2013-04-26 14:48:49 Re: libpq COPY handling