Elimination of the repetitive code at the SLRU bootstrap functions.

Evgeny Voropaev <evgeny.voropaev@tantorlabs.com>

From: Evgeny Voropaev <evgeny.voropaev@tantorlabs.com>
To: pgsql-hackers@postgresql.org
Date: 2025-02-13T07:15:01Z
Lists: pgsql-hackers

Attachments

Hello hackers!

The functions, bootstrapping SLRU pages, such as BootStrapMultiXact, 
BootStrapCLOG, ActivateCommitTs, multixact_redo and others, have a lot 
of repetitive code.

A new proposed function BootStrapSlruPage moves a duplicating code into 
the single place. Additionally, a new member ZeroFunc is implemented in 
the SlruCtlData structure. The ZeroFunc keeps a pointer to a function 
proper for nullifying SLRU pages of a type defined by a corresponding 
SlruCtlData object.

Applying proposed modifications can simplify maintenance and future 
development of Postgres code in the realm of bootstrapping SLRU.

Best regards,
Evgeny Voropaev,
Tantor Labs LLC.