pgsql: localbuf: Introduce TerminateLocalBufferIO()

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: localbuf: Introduce TerminateLocalBufferIO()
Date: 2025-03-16 02:18:20
Message-ID: E1ttda0-002gW3-0z@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

localbuf: Introduce TerminateLocalBufferIO()

Previously TerminateLocalBufferIO() was open-coded in multiple places, which
doesn't seem like a great idea. While TerminateLocalBufferIO() currently is
rather simple, an upcoming patch requires additional code to be added to
TerminateLocalBufferIO(), making this modification particularly worthwhile.

For some reason FlushRelationBuffers() previously cleared BM_JUST_DIRTIED,
even though that's never set for temporary buffers. This is not carried over
as part of this change.

Reviewed-by: Melanie Plageman <melanieplageman(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAAKRu_b9anbWzEs5AAF9WCvcEVmgz-1AkHSQ-CLLy-p7WHzvFw@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 32 +++++++++-----------------------
src/backend/storage/buffer/localbuf.c | 29 ++++++++++++++++++++++++++---
src/include/storage/buf_internals.h | 2 ++
3 files changed, 37 insertions(+), 26 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2025-03-16 10:32:42 pgsql: pg_createsubscriber: Remove some code bloat in the atexit() call
Previous Message Andrew Dunstan 2025-03-15 21:44:26 pgsql: Silence perl critic