pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: bufmgr: Switch to standard order in MarkBufferDirtyHint()
Date: Wed, 11 Mar 2026 19:02:57 +0000
Message-ID: <E1w0Opd-003Vf6-35@gemulon.postgresql.org> (raw)

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(-)



Message-ID: <E1w0Opd-003Vf6-35@gemulon.postgresql.org>
Permalink:  ../E1w0Opd-003Vf6-35@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w0Opd-003Vf6-35@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: bufmgr: Switch to standard order in MarkBufferDirtyHint()
  In-Reply-To: <E1w0Opd-003Vf6-35@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox