pgsql: heapam: Don't mimic MarkBufferDirtyHint() in inplace updates

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: heapam: Don't mimic MarkBufferDirtyHint() in inplace updates
Date: 2026-03-10 16:01:32
Message-ID: E1vzzWW-003Kay-26@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

heapam: Don't mimic MarkBufferDirtyHint() in inplace updates

Previously heap_inplace_update_and_unlock() used an operation order similar to
MarkBufferDirty(), to reduce the number of different approaches used for
updating buffers. However, in an upcoming patch, MarkBufferDirtyHint() will
switch to using the update protocol used by most other places (enabled by hint
bits only being set while holding a share-exclusive lock).

Luckily it's pretty easy to adjust heap_inplace_update_and_unlock(). As a
comment already foresaw, we can use the normal order, with the slight change
of updating the buffer contents after WAL logging.

Reviewed-by: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Reviewed-by: Noah Misch <noah(at)leadboat(dot)com>
Discussion: https://postgr.es/m/5ubipyssiju5twkb7zgqwdr7q2vhpkpmuelxfpanetlk6ofnop@hvxb4g2amb2d

Branch
------
master

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

Modified Files
--------------
src/backend/access/heap/heapam.c | 35 +++++++++++++----------------------
1 file changed, 13 insertions(+), 22 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Masahiko Sawada 2026-03-10 18:38:47 pgsql: Fix grammar in short description of effective_wal_level.
Previous Message Álvaro Herrera 2026-03-10 15:09:06 pgsql: pg_dumpall: simplify coding of dropDBs()