bufmgr: Switch to standard order in MarkBufferDirtyHint()
Andres Freund <andres@anarazel.de>
bufmgr: Switch to standard order in MarkBufferDirtyHint() When we were updating hint bits with just a share lock MarkBufferDirtyHint() had to use a non-standard order of operations, i.e. WAL log the buffer before marking the buffer dirty. This was required because the lock level used to set hints did not conflict with the lock level that was used to flush pages, which would have allowed flushing the page out before the WAL record. The non-standard order in turn required preventing the checkpoint from starting between writing the WAL record and flushing out the page. Now that setting hints and writing out buffers use share-exclusive, we can revert back to the normal order of operations. Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi> Discussion: https://postgr.es/m/5ubipyssiju5twkb7zgqwdr7q2vhpkpmuelxfpanetlk6ofnop@hvxb4g2amb2d
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/transam/xloginsert.c | modified | +14 −6 |
| src/backend/storage/buffer/bufmgr.c | modified | +26 −35 |
Discussion
- Buffer locking is special (hints, checksums, AIO writes) 120 messages · 2025-08-22 → 2026-04-03