Re: [COMMITTERS] pgsql: Fix bufmgr so CHECKPOINT_END_OF_RECOVERY behaves as a shutdown c

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Fix bufmgr so CHECKPOINT_END_OF_RECOVERY behaves as a shutdown c
Date: 2012-09-17 14:59:06
Message-ID: CA+TgmoZoWgNpZXvCSTTzc-=i0+KbZOC5N5s=smwyxKcgkRM65w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Sun, Sep 16, 2012 at 2:54 PM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> Fix bufmgr so CHECKPOINT_END_OF_RECOVERY behaves as a shutdown checkpoint.
> Recovery code documents clearly that a shutdown checkpoint is executed at
> end of recovery - a shutdown checkpoint WAL record is written but the buffer
> manager had been altered to treat end of recovery as a normal checkpoint.
> This bug exacerbates the bufmgr relpersistence bug.
>
> Bug spotted by Andres Freund, patch by me.

I am confused by this patch. It seems to me that the effect of this
patch is to force unlogged buffers to be written at end-of-recovery as
well as at shutdown. But, barring bugs elsewhere, there shouldn't be
any unlogged buffers in shared_buffers at end-of-recovery, so this
won't make any difference at all. Am I missing something?

Maybe what we should do is - if this is an end-of-recovery checkpoint
- *assert* that the BM_PERMANENT bit is set on every buffer we find.
That would provide a useful cross-check that we don't have a bug
similar to the one Jeff already fixed in any other code path.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2012-09-17 15:14:51 Re: [COMMITTERS] pgsql: Fix bufmgr so CHECKPOINT_END_OF_RECOVERY behaves as a shutdown c
Previous Message Tom Lane 2012-09-17 13:58:37 Re: Re: [COMMITTERS] pgsql: Properly set relpersistence for fake relcache entries.

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2012-09-17 15:14:51 Re: [COMMITTERS] pgsql: Fix bufmgr so CHECKPOINT_END_OF_RECOVERY behaves as a shutdown c
Previous Message Andres Freund 2012-09-17 14:35:48 Re: [PATCH 3/8] Add support for a generic wal reading facility dubbed XLogReader