Re: Unlogged tables and BufferSync()

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Unlogged tables and BufferSync()
Date: 2012-01-06 13:25:35
Message-ID: CA+TgmoZnjXtsCn7vwFr21JrYAgSVh-pimFW0CsSAVSO7HxaiVA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 6, 2012 at 7:52 AM, Heikki Linnakangas
<heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> In BufferSync(), we have this:
>
>>        /*
>>         * Unless this is a shutdown checkpoint, we write only permanent,
>> dirty
>>         * buffers.  But at shutdown time, we write all dirty buffers.
>>         */
>>        if (!(flags & CHECKPOINT_IS_SHUTDOWN))
>>                flags |= BM_PERMANENT;
>
>
> That seems bogus to me. We're mixing CHECKPOINT_* flags and buffer BM_*
> flags in the same variable. Furthermore, we only use that flags variable to
> pass it down to CheckpointWriteDelay(), which only pays attention to
> CHECKPOINT_IMMEDIATE flag. The intention was probably to do "mask |=
> BM_PERMANENT" ?

Ouch. Yeah, that's a bug, will fix.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Beattie 2012-01-06 13:28:48 Re: FATAL: bogus data in lock file "postmaster.pid": ""
Previous Message Heikki Linnakangas 2012-01-06 12:52:03 Unlogged tables and BufferSync()