pgsql: Avoid WAL flush checks for unlogged buffers in GetVictimBuffer() - Mailing list pgsql-committers

From Melanie Plageman
Subject pgsql: Avoid WAL flush checks for unlogged buffers in GetVictimBuffer()
Date
Msg-id E1w0Ofx-003VZb-37@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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(-)


pgsql-committers by date:

Previous
From: Tomas Vondra
Date:
Subject: pgsql: Do not lock in BufferGetLSNAtomic() on archs with 8 byte atomic
Next
From: Andres Freund
Date:
Subject: pgsql: bufmgr: Remove the, now obsolete, BM_JUST_DIRTIED