Re: [PATCH] introduce XLogLockBlockRangeForCleanup() - Mailing list pgsql-hackers

From Amit Khandekar
Subject Re: [PATCH] introduce XLogLockBlockRangeForCleanup()
Date
Msg-id CACoZds3KL9MxRe5PPDruT2s+Ay==iGrWGLHJqPygPTtXciR_=g@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] introduce XLogLockBlockRangeForCleanup()  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: [PATCH] introduce XLogLockBlockRangeForCleanup()
List pgsql-hackers



On 3 July 2014 16:59, Simon Riggs <simon@2ndquadrant.com> wrote:

I think we should say this though

LockBufHdr(buf);
valid = ((buf->flags & BM_VALID) != 0);
if (valid)
    PinBuffer_Locked(buf);
else
    UnlockBufHdr(buf);

since otherwise we would access the buffer flags without the spinlock
and we would leak a pin if the buffer was not valid

Ah right. That is essential. 

pgsql-hackers by date:

Previous
From: Kyotaro HORIGUCHI
Date:
Subject: Re: WAL replay bugs
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: WAL replay bugs