Tom Lane wrote:

Note that buffer 160 gets cleared twice in this sequence.  The second
time, the CDB for 174 gets found, leading to failure when 174 is cleared.

I believe the correct fix is to do CLEAR_BUFFERTAG on the buffer (and
maybe the CDB too?) when returning a buffer to the freelist in StrategyInvalidateBuffer. It might also be worthwhile to add another
BM_FLAG bit that specifically indicates a buffer is on the freelist,
and set/clear/test that at appropriate spots.

That was the place I intended to do it.



I am actually of the opinion that the assertion code at the bottom of StrategyInvalidateBuffer is all wrong: it should *never* be possible to call StrategyInvalidateBuffer on something that's already in the freelist, and the only reason you had that in there was because of this mistaken failure to clear the buffertag, leading to wrong calls from linear searches of the buffer array. I think you should just elog(ERROR) any time you fail to find a CDB in this routine.

That is corrent.



Jan


--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== [EMAIL PROTECTED] #


---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster

Reply via email to