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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers