Unlogged tables and BufferSync()

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Robert Haas <robert(dot)haas(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Unlogged tables and BufferSync()
Date: 2012-01-06 12:52:03
Message-ID: 4F06EE73.5040502@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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" ?

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-01-06 13:25:35 Re: Unlogged tables and BufferSync()
Previous Message Magnus Hagander 2012-01-06 11:13:25 Re: FATAL: bogus data in lock file "postmaster.pid": ""