Re: Race conditions, race conditions! - Mailing list pgsql-hackers

From Qingqing Zhou
Subject Re: Race conditions, race conditions!
Date
Msg-id ddua5i$79h$1@news.hub.org
Whole thread Raw
In response to Re: Race conditions, race conditions!  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Race conditions, race conditions!  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
"Tom Lane" <tgl@sss.pgh.pa.us> writes:
>
> This is entirely likely to find the same non-BM_VALID buffer that was
> assigned in the first iteration.
>

So after we found it, we still need to extend the file. In ReadBuffer():

---/* if it was already in the buffer pool, we're done */if (found){ ... return BufferDescriptorGetBuffer(bufHdr);}
/* ... so future attempts ... come right back here to * try smgrextend again. */
---

Shall we write
   /* If it was already in the buffer pool and not for extension, we're
done */   if (found && !isExtend)

instead?

Regards,
Qingqing





pgsql-hackers by date:

Previous
From: Christopher Kings-Lynne
Date:
Subject: Re: pl/Ruby, deprecating plPython and Core
Next
From: Tom Lane
Date:
Subject: Re: Race conditions, race conditions!