pgsql: bufmgr: Switch to standard order in MarkBufferDirtyHint() - Mailing list pgsql-committers

From Andres Freund
Subject pgsql: bufmgr: Switch to standard order in MarkBufferDirtyHint()
Date
Msg-id E1w0Opd-003Vf6-35@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a766125efd60ddc8358979322496a8e0fd8746c4

Modified Files
--------------
src/backend/access/transam/xloginsert.c | 20 +++++++----
src/backend/storage/buffer/bufmgr.c     | 61 ++++++++++++++-------------------
2 files changed, 40 insertions(+), 41 deletions(-)


pgsql-committers by date:

Previous
From: Melanie Plageman
Date:
Subject: pgsql: Avoid WAL flush checks for unlogged buffers in GetVictimBuffer()
Next
From: Andrew Dunstan
Date:
Subject: pgsql: Add support for altering CHECK constraint enforceability