pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Álvaro Herrera <alvherre@kurilemu.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Refactor some repetitive SLRU code
Date: Mon, 07 Jul 2025 14:54:49 +0000
Message-ID: <E1uYnF3-0057wB-0Q@gemulon.postgresql.org> (raw)

Refactor some repetitive SLRU code

Functions to bootstrap and zero pages in various SLRU callers were
fairly duplicative.  We can slash almost two hundred lines with a couple
of simple helpers:

 - SimpleLruZeroAndWritePage: Does the equivalent of SimpleLruZeroPage
   followed by flushing the page to disk
 - XLogSimpleInsertInt64: Does a XLogBeginInsert followed by XLogInsert
   of a trivial record whose data is just an int64.

Author: Evgeny Voropaev <evgeny.voropaev@tantorlabs.com>
Reviewed by: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed by: Andrey Borodin <x4mmm@yandex-team.ru>
Reviewed by: Aleksander Alekseev <aleksander@timescale.com>
Discussion: https://www.postgresql.org/message-id/flat/97820ce8-a1cd-407f-a02b-47368fadb14b%40tantorlabs.com

Branch
------
master

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

Modified Files
--------------
src/backend/access/transam/clog.c       |  67 ++----------------
src/backend/access/transam/commit_ts.c  |  66 +++---------------
src/backend/access/transam/multixact.c  | 120 ++++----------------------------
src/backend/access/transam/slru.c       |  25 +++++++
src/backend/access/transam/subtrans.c   |  34 ++-------
src/backend/access/transam/xloginsert.c |  12 ++++
src/include/access/slru.h               |   1 +
src/include/access/xloginsert.h         |   1 +
8 files changed, 71 insertions(+), 255 deletions(-)



Message-ID: <E1uYnF3-0057wB-0Q@gemulon.postgresql.org>
Permalink:  ../E1uYnF3-0057wB-0Q@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uYnF3-0057wB-0Q@gemulon.postgresql.org

 · 

reply

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: alvherre@kurilemu.de, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Refactor some repetitive SLRU code
  In-Reply-To: <E1uYnF3-0057wB-0Q@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