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

Re: GIN, XLogInsert and MarkBufferDirty

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: teodor(at)postgresql(dot)org, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: GIN, XLogInsert and MarkBufferDirty
Date: 2007-06-05 15:25:10
Message-ID: 46658056.5060303@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Tom Lane wrote:
> Heikki Linnakangas <heikki(at)enterprisedb(dot)com> writes:
>> ... MarkBufferDirty needs to be called 
>> before XLogInsert to avoid a race condition in checkpoint, see comments 
>> in SyncOneBuffer in bufmgr.c for an explanation.
> 
> Right, see also the "Write-Ahead Log coding" section in
> src/backend/access/transam/README (which is maybe not a very good place
> for it, but it doesn't seem like bufmgr's turf either).

Yeah it could be documented more visibly, I didn't know about (or didn't 
remember) that rule until I saw that comment today. I found that issue 
in GIN by just quickly grepping for callers of MarkBufferDirty.

How about adding an Assert to XLogInsert to check that all buffers given 
to it are already marked as dirty? It wouldn't be completely 
water-tight, sometimes we don't pass the buffer to XLogInsert even 
though we stamp the LSN, but it would catch most cases.


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

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2007-06-05 15:30:37
Subject: Re: libpq and Binary Data Formats
Previous:From: Bernd HelmleDate: 2007-06-05 15:20:10
Subject: Re: [COMMITTERS] pgsql: Create a GUC parametertemp_tablespacesthat allows selection of

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