pgsql: refactor: Move BackendWritebackContext initialization

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: refactor: Move BackendWritebackContext initialization
Date: 2026-10-09 22:21:04
Message-ID: E1xFIxc-000000010DU-469m@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

refactor: Move BackendWritebackContext initialization

BackendWritebackContext is a purely per-process thing, so it feels
wrong to initialize it in the shmem init/attach functions. Move the
initialization to InitBufferManagerAccess() instead.

Backpatch to version 19, where the new shared memory callbacks system
was introduced. While this isn't new with that, it made the ShmemInit
functions more closely related to shared memory initialization than
before.

Reviewed-by: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Reviewed-by: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/fb1bd612-4a58-4235-976f-2b2ef036bfff@iki.fi
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1feb619383d05395936c6c52144500c7becb409e

Modified Files
--------------
src/backend/storage/buffer/buf_init.c | 15 ---------------
src/backend/storage/buffer/bufmgr.c | 6 ++++++
src/include/storage/buf_internals.h | 1 -
3 files changed, 6 insertions(+), 16 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Richard Guo 2026-10-10 00:23:29 pgsql: Don't trust NOT NULL on virtual generated columns of partitioned
Previous Message Heikki Linnakangas 2026-10-09 21:29:13 pgsql: Fix check on test function's arguments