XLogFlush
От | Jeff Janes |
---|---|
Тема | XLogFlush |
Дата | |
Msg-id | f67928030908210118v6de56085h89310307ee977170@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: XLogFlush
Re: XLogFlush Re: XLogFlush |
Список | 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 по дате отправления: