Re: [PATCHES] Infrastructure changes for recovery (v8)

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] Infrastructure changes for recovery (v8)
Date: 2008-10-08 13:34:58
Message-ID: 1223472898.4747.310.camel@ebony.2ndQuadrant
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


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 Content-Type Size
recovery_infrastruc.v9.patch text/x-patch 76.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chris Mayfield 2008-10-08 13:51:26 Re: Building Postgres in Eclipse
Previous Message Merlin Moncure 2008-10-08 13:26:17 Re: WITH RECURSIVE ... CYCLE in vanilla SQL: issues with arrays of rows

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2008-10-20 19:23:28 Re: Subtransaction commits and Hot Standby
Previous Message Simon Riggs 2008-10-08 12:24:20 Re: [PATCHES] Infrastructure changes for recovery (v8)