Re: Elimination of the repetitive code at the SLRU bootstrap functions.

From: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Evgeny <evorop(at)gmail(dot)com>
Cc: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, Aleksander Alekseev <aleksander(at)timescale(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Elimination of the repetitive code at the SLRU bootstrap functions.
Date: 2025-07-07 15:01:52
Message-ID: 202507071501.hk5v4j7xdv3s@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2025-Jul-02, Evgeny wrote:

> Álvaro, Andrey, Alexander, hello!
>
> Since the master branch became the PG19dev and PG18 is now stable, I have
> directed this patch into PG19. Could we continue with it now?

Sure, I pushed your patch now.

> Álvaro, should I rename the SimpleLruZeroPageExt function?

Well, I didn't like that name -- normally, names ending in Ext represent
a version of the routine named without the "Ext" that has some additions
to its argument list, so the Ext is an extended version or something
like that. That pattern does not fit this case. I used the name
"SimpleLruZeroAndWritePage" instead, and rewrote the comment to explain
that it's a simple wrapper that does exactly what the name says.
Because of this I also removed some comments in the callsites, because
those would have been redundant with the new name. So, no you don't
need to do anything, because I already did it.

I also went back and accepted Andrey's suggestion to have Int64 in the
name of the XLogSimpleInsert routine, because it's not totally
unthinkable that we'll have some other simple wrapper in the future.
I made it return the LSN, because while no current caller needs it, some
external caller might want to have that.

I also moved each routine to a more natural place, namely just below the
function they wrap. The pattern of adding stuff at the end of the file
just results in messy code, so don't do that.

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"Tiene valor aquel que admite que es un cobarde" (Fernandel)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2025-07-07 15:04:26 Re: Inconsistent LSN format in pg_waldump output
Previous Message Japin Li 2025-07-07 14:55:36 Re: Inconsistent LSN format in pg_waldump output