From: Melanie Plageman <melanieplageman@gmail.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid WAL flush checks for unlogged buffers in GetVictimBuffer()
Date: Wed, 11 Mar 2026 18:52:57 +0000
Message-ID: <E1w0Ofx-003VZb-37@gemulon.postgresql.org> (raw)
Avoid WAL flush checks for unlogged buffers in GetVictimBuffer()
GetVictimBuffer() rejects a victim buffer if it is from a bulkread
strategy ring and reusing it would require flushing WAL. Unlogged table
buffers can have fake LSNs (e.g. unlogged GiST pages) and calling
XLogNeedsFlush() on a fake LSN is meaningless.
This is a bit of future-proofing because currently the bulkread strategy
is not used for relations with fake LSNs.
Author: Melanie Plageman <melanieplageman@gmail.com>
Reported-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Andres Freund <andres@anarazel.de>
Earlier version reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/flat/fmkqmyeyy7bdpvcgkheb6yaqewemkik3ls6aaveyi5ibmvtxnd%40nu2kvy5rq3a6
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/11e0824bd97e1639f9358260f389083135e0b5e3
Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
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: melanieplageman@gmail.com, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Avoid WAL flush checks for unlogged buffers in GetVictimBuffer()
In-Reply-To: <E1w0Ofx-003VZb-37@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