Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] Infrastructure changes for recovery

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: List pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Infrastructure changes for recovery
Date: 2008-08-31 20:04:34
Message-ID: 1220213074.4371.173.camel@ebony.2ndQuadrant (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-patches
On Thu, 2008-08-07 at 12:44 +0100, Simon Riggs wrote:
> I would like to propose some changes to the infrastructure for recovery.
> These changes are beneficial in themselves, but also form the basis for
> other work we might later contemplate.
> Currently 
> * the startup process performs restartpoints during recovery
> * the death of the startup process is tied directly to the change of
> state in the postmaster following recovery
> I propose to
> * have startup process signal postmaster when it starts Redo phase (if
> it starts it)

> Decoupling things in this way allows us to
> 1. arrange for the bgwriter to start during Redo, so it can:
> i) clean dirty blocks for the startup process
> ii) perform restartpoints in background
>   Both of these aspects will increase performance of recovery

Taking into account comments from Tom and Alvaro

Included patch with the following changes:

* new postmaster mode known as consistent recovery, entered only when
recovery passes safe/consistent point. InRedo is now set in all
processes when started/connected in consistent recovery mode.

* bgwriter and stats process starts in consistent recovery mode.
bgwriter changes mode when startup process completes.

* bgwriter now performs restartpoints and also cleans shared_buffers
while the startup process performs redo apply

* recovery.conf parameter log_restartpoints is now deprecated, since
function overlaps with log_checkpoints too much. I've kept the
distinction between restartpoints and checkpoints in code, to avoid
convoluted code. Minor change, not critical.

[Replying to one of Alvaro's other comments: Startup process still uses
XLogReadBuffer. I'm not planning on changing that either, at least not
in this patch.]

Patch doesn't conflict with rmgr plugin patch.

Passes make check, but that's easy.
Various other tests all seem to be working.

 Simon Riggs 
 PostgreSQL Training, Services and Support

Attachment: recovery_infrastruc.v2.patch
Description: text/x-patch (31.3 KB)

In response to


pgsql-hackers by date

Next:From: Radek StrnadDate: 2008-08-31 21:32:30
Subject: WIP patch: Collation support
Previous:From: Tom LaneDate: 2008-08-31 17:50:27
Subject: Re: Cause of occasional buildfarm failures in sequence test

pgsql-patches by date

Next:From: Ryan BradetichDate: 2008-08-31 20:35:46
Subject: [PgFoundry] Unsigned Data Types [1 of 2]
Previous:From: Simon RiggsDate: 2008-08-31 09:52:52
Subject: WIP Join Removal

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group