Re: [HACKERS] Infrastructure changes for recovery - Mailing list pgsql-patches

From Simon Riggs
Subject Re: [HACKERS] Infrastructure changes for recovery
Date
Msg-id 1222121161.4445.248.camel@ebony.2ndQuadrant
Whole thread Raw
In response to Re: [HACKERS] Infrastructure changes for recovery  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] Infrastructure changes for recovery
List pgsql-patches
On Thu, 2008-09-18 at 10:09 -0400, Tom Lane wrote:
> Simon Riggs <simon@2ndQuadrant.com> writes:
> > On Thu, 2008-09-18 at 09:06 -0400, Tom Lane wrote:
> >> Do we really need a checkpoint there at all?
>
> > "Timelines only change at shutdown checkpoints".
>
> Hmm.  I *think* that that is just a debugging crosscheck rather than a
> critical property.  But yeah, it would take some close investigation,
> which maybe isn't warranted if you have a less-invasive solution.

OK, new patch, version 6. Some major differences to previous patch.

* new IsRecoveryProcessingMode() in shmem
* padding in XLogCtl to ensure above call is cheap
* specific part of bgwriter shmem for passing restartpoint data
* avoid Shutdown checkpoint at end of recovery, with carefully
considered positioning of statements (beware!)
* only one new postmaster mode, PM_RECOVERY
* bgwriter changes state without stopping/starting

Modes I have tested so far
* make check
* Start, Stop
* Crash Recovery
* Archive Recovery
* Archive Recovery, switch in middle of restartpoint

Modes not yet tested
* EXEC_BACKEND

Ready for serious review prior to commit. I will be performing further
testing also.

 backend/access/transam/multixact.c |    2
 backend/access/transam/xlog.c      |  328 ++++++++++++---!!!!!!!!!!!!
 backend/postmaster/bgwriter.c      |  371 +++++---!!!!!!!!!!!!!!!!!!!!!
 backend/postmaster/postmaster.c    |   62 ++++!!
 backend/storage/buffer/README      |    5
 backend/storage/buffer/bufmgr.c    |   34 +!!
 include/access/xlog.h              |   14 !
 include/access/xlog_internal.h     |    3
 include/catalog/pg_control.h       |    2
 include/postmaster/bgwriter.h      |    2
 include/storage/bufmgr.h           |    2
 include/storage/pmsignal.h         |    1
 12 files changed, 279 insertions(+), 56 deletions(-), 491 mods(!)

There's a few subtle points along the way. I've tried to explain them
all in code comments, but questions welcome. At v6, most things are now
done a particular way for a specific reason.

Look especially at InRecovery, which is used extensively in different
parts of the code. The meaning of this has been subdivided into two
meanings, so only *some* of the places that use it have been changed.
All have been checked.

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

Attachment

pgsql-patches by date:

Previous
From: "Ryan Bradetich"
Date:
Subject: Re: [PgFoundry] Unsigned Data Types [1 of 2]
Next
From: "Alex Hunsaker"
Date:
Subject: Re: hash index improving v3