Re: [HACKERS] Restartable Recovery

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org, Andreas Seltenreich <andreas+pg(at)gate450(dot)dyndns(dot)org>, Marko Kreen <markokr(at)gmail(dot)com>, Teodor Sigaev <teodor(at)sigaev(dot)ru>
Subject: Re: [HACKERS] Restartable Recovery
Date: 2006-08-01 00:09:55
Message-ID: 200608010009.k7109te19208@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


Nice. I was going to ask if this could make it into 8.2.

---------------------------------------------------------------------------

Simon Riggs wrote:
> On Sun, 2006-07-16 at 20:56 +0100, Simon Riggs wrote:
> > On Sun, 2006-07-16 at 15:33 -0400, Tom Lane wrote:
> > > Simon Riggs <simon(at)2ndquadrant(dot)com> writes:
> > > > On Sun, 2006-07-16 at 12:40 -0400, Tom Lane wrote:
> > > >> A compromise that might be good enough is to add an rmgr routine defined
> > > >> as "bool is_idle(void)" that tests whether the rmgr has any open state
> > > >> to worry about. Then, recovery checkpoints are done only if all rmgrs
> > > >> say they are idle.
> > >
> > > > Perhaps that should be extended to say whether there are any
> > > > non-idempotent changes made in the last checkpoint period. That might
> > > > cover a wider set of potential actions.
> > >
> > > Perhaps best to call it safe_to_checkpoint(), and not pre-judge what
> > > reasons the rmgr might have for not wanting to restart here.
> >
> > You read my mind.
> >
> > > If we are only going to do a recovery checkpoint at every Nth checkpoint
> > > record, then occasionally having to skip one seems no big problem ---
> > > just do it at the first subsequent record that is safe.
> >
> > Got it.
>
> I've implemented this for BTree, GIN, GIST using an additional rmgr
> function bool rm_safe_restartpoint(void)
>
> The functions are actually trivial, assuming I've understood this and
> how GIST and GIN work for their xlogging.
>
> "Recovery checkpoints" are now renamed "restartpoints" to avoid
> confusion with checkpoints. So checkpoints occur during normal
> processing (only) and restartpoints occur during recovery (only).
>
> Updated patch enclosed, which I believe has no conflicts with the other
> patches on xlog.c just submitted.
>
> Much additional testing required, but the underlying concepts are very
> simple really. Andreas: any further gotchas? :-)
>
> --
> Simon Riggs
> EnterpriseDB http://www.enterprisedb.com

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2006-08-01 00:23:13 Standby Mode
Previous Message Bruce Momjian 2006-08-01 00:09:06 pgsql: Improvements to Maintenance and External Projects documentation.

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2006-08-01 00:10:07 Re: Maintenance and External Projects (try 2)
Previous Message Simon Riggs 2006-08-01 00:04:07 Re: [HACKERS] Restartable Recovery