Re: [PATCHES] Infrastructure changes for recovery (v8) - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: [PATCHES] Infrastructure changes for recovery (v8)
Date
Msg-id 1223472898.4747.310.camel@ebony.2ndQuadrant
Whole thread Raw
In response to Re: [PATCHES] Infrastructure changes for recovery (v8)  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: [PATCHES] Infrastructure changes for recovery (v8)
Re: [PATCHES] Infrastructure changes for recovery (v8)
Re: [PATCHES] Infrastructure changes for recovery (v8)
List pgsql-hackers
On Wed, 2008-10-08 at 13:24 +0100, Simon Riggs wrote:
> On Wed, 2008-10-08 at 14:43 +0300, Heikki Linnakangas wrote:

> > Again, perhaps we should do
> > this as a separate patch.

New patch enclosed with other stuff stripped out. 15% lighter...

New thread spawned for bug fix patch. Will resubmit others when we can
be sure they'll not cause patch conflicts.

> OK, I'll strip all of the above out, for separate consideration.
> The form is this

> PM_START    startup process performs restartpoints
>         transition when database is consistent state
> PM_RECOVERY    bgwriter process performs restartpoints
>         delicate transition between two states
> PM_RUN        bgwriter process performs checkpoints

Above added as comments in patch.

The patch agonises over the two state transitions above. First
transition needs to be exactly correct otherwise we might be using an
inconsistent database during recovery. Second transition is harder
because it isn't just the startup process working alone any more.

The key to understanding it is all in concurrent behaviour. Startup and
bgwriter chat together through bgwriter shared memory and call functions
back and forth between xlog.c and bgwriter.c.

I haven't retested the patch yet, but it passes make check. I'll be
rechecking it later today, starting in about 2 hours time.

--
 Simon Riggs           www.2ndQuadrant.com
 PostgreSQL Training, Services and Support

Attachment

pgsql-hackers by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: WITH RECURSIVE ... CYCLE in vanilla SQL: issues with arrays of rows
Next
From: "Dave Page"
Date:
Subject: Re: Building Postgres in Eclipse