Re: MultiXact\SLRU buffers configuration

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>, vignesh C <vignesh21(at)gmail(dot)com>, Andrew Borodin <amborodin86(at)gmail(dot)com>, i(dot)lazarev(at)postgrespro(dot)ru, Yura Sokolov <y(dot)sokolov(at)postgrespro(dot)ru>, Andres Freund <andres(at)anarazel(dot)de>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Gilles Darold <gilles(at)darold(dot)net>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>, Anastasia Lubennikova <a(dot)lubennikova(at)postgrespro(dot)ru>, Daniel Gustafsson <daniel(at)yesql(dot)se>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, pgsql-hackers mailing list <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: MultiXact\SLRU buffers configuration
Date: 2024-08-21 06:26:05
Message-ID: ZsWH4HgIitscS6RE@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Aug 21, 2024 at 12:46:31PM +0900, Michael Paquier wrote:
> Sorry, I should have split that for clarity (one patch for the GUC,
> one to change the test to use CACHED/LOAD). It is not an error
> though: if we don't have a controlled way to disable the stats of the
> module, then the test would fail when calling the cached callback
> because we'd try to allocate some memory for the dshash entry in
> pgstats.
>
> The second effect of initializing the shmem state of the module with
> shared_preload_libraries is condition variables are set up for the
> sake if the test, removing the dependency to the SQL load() call.
> Both are OK, but I'd prefer introducing one use case for these two
> macros in the tree, so as these can be used as a reference in the
> future when developing new tests.

In short, here is a better patch set, with 0001 and 0002 introducing
the pieces that the test would need to be able to use the LOAD() and
CACHED() macros in 0003:
- 0001: Add shmem callbacks to initialize shmem state of
injection_points with shared_preload_libraries.
- 0002: Add a GUC to control if the stats of the module are enabled.
By default, they are disabled as they are only needed in the TAP test
of injection_points for the stats.
- 0003: Update the SLRU test to use INJECTION_POINT_LOAD and
INJECTION_POINT_CACHED with injection_points loaded via
shared_preload_libraries, removing the call to
injection_points_load() in the perl test.

What do you think?
--
Michael

Attachment Content-Type Size
0001-injection_points-Add-initialization-of-shmem-state-a.patch text/x-diff 3.6 KB
0002-injection_point-Add-injection_points.stats.patch text/x-diff 5.7 KB
0003-Rework-new-SLRU-test-with-injection-points.patch text/x-diff 2.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2024-08-21 06:29:39 Re: configure failures on chipmunk
Previous Message Amit Kapila 2024-08-21 06:25:13 Re: Taking into account syncrep position in flush_lsn reported by apply worker