Re: Race conditions, race conditions!

From: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Race conditions, race conditions!
Date: 2005-08-17 03:13:31
Message-ID: ddua5i$79h$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-08-17 03:53:04 Re: Race conditions, race conditions!
Previous Message Christopher Kings-Lynne 2005-08-17 02:56:42 Re: pl/Ruby, deprecating plPython and Core