XLogFlush - Mailing list pgsql-hackers

From Jeff Janes
Subject XLogFlush
Date
Msg-id f67928030908210118v6de56085h89310307ee977170@mail.gmail.com
Whole thread Raw
Responses Re: XLogFlush
Re: XLogFlush
Re: XLogFlush
List pgsql-hackers
Maybe this is one of those things that is obvious when someone points
it out to you, but right now I am not seeing it.  If you look at the
last eight lines of this snippet from XLogFlush, you see that if we
obtain WriteRqstPtr under the WALInsertLock, then we both write and
flush up to the highest write request.  But if we obtain it under the
info_lck, then we write up to the highest write request but flush only
up to our own records flush request.  Why the disparate treatment?
The effect of this seems to be that when WALInsertLock is busy, group
commits are suppressed.

if (LWLockConditionalAcquire(WALInsertLock, LW_EXCLUSIVE)){    XLogCtlInsert *Insert = &XLogCtl->Insert;    uint32
 freespace = INSERT_FREESPACE(Insert);        if (freespace < SizeOfXLogRecord)        /* buffer is full */
WriteRqstPtr= XLogCtl->xlblocks[Insert->curridx];    else    {        WriteRqstPtr =
XLogCtl->xlblocks[Insert->curridx];       WriteRqstPtr.xrecoff -= freespace;    }    LWLockRelease(WALInsertLock);
WriteRqst.Write= WriteRqstPtr;    WriteRqst.Flush = WriteRqstPtr;}else{    WriteRqst.Write = WriteRqstPtr;
WriteRqst.Flush= record;}
 

Cheers,

Jeff


pgsql-hackers by date:

Previous
From: Nikhil Sontakke
Date:
Subject: Re: UPDATE ... SET (a, b, c) = (expr)
Next
From: Paul Matthews
Date:
Subject: Geometric Elimination