Re: Bug in new buffer freelist code
От | Jan Wieck |
---|---|
Тема | Re: Bug in new buffer freelist code |
Дата | |
Msg-id | 3FFC421A.6040408@Yahoo.com обсуждение исходный текст |
Ответ на | Re: Bug in new buffer freelist code (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
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. # #================================================== JanWieck@Yahoo.com #
В списке pgsql-hackers по дате отправления: