Re: Bug in new buffer freelist code - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Bug in new buffer freelist code
Date
Msg-id 1581.1072218763@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bug in new buffer freelist code  (Jan Wieck <JanWieck@Yahoo.com>)
List pgsql-hackers
Jan Wieck <JanWieck@Yahoo.com> writes:
>> Let me know if there's any test I could run to confirm your theory,
>> assuming I can make it happen again after I finish rebuilding.

> You could add another assertion that checks that the CDB found is 
> actually pointing to the buffer that is being invalidated.

Good thought.  What would that look like exactly?

> Looking at the bufmgr.c code for FlushRelationBuffers() ... it does 
> exactly what I described ... leaving the relnode and buffernum for an 
> invalidated buffer just where they are.

Yeah.  I don't think FlushRelationBuffers() is the place to fix it
though; if you try to fix it at that level there will be several places
to do it (DropBuffers etc).  It's unclear to me what the division of
labor is now between BufTableDelete and freelist.c, so I'm not sure
where you *should* fix it ... but it should be as close as possible to
where the buffer is removed from the hashtable, IMHO.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Jan Wieck
Date:
Subject: Re: Bug in new buffer freelist code
Next
From: "Andrew Dunstan"
Date:
Subject: Re: PostgreSQL port to pure Java?