Re: Flush SLRU counters in checkpointer process - Mailing list pgsql-hackers

From Anthonin Bonnefoy
Subject Re: Flush SLRU counters in checkpointer process
Date
Msg-id CAO6_XqqqEHzKC5+qBZg+NASbGyVHHs=gFjRP46Hi8DMR4+VJRg@mail.gmail.com
Whole thread Raw
In response to Re: Flush SLRU counters in checkpointer process  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: Flush SLRU counters in checkpointer process
List pgsql-hackers
I think I've managed to reproduce the issue. The test I've added to check slru flush was the one failing in the regression suite.

SELECT SUM(flushes) > :slru_flushes_before FROM pg_stat_slru;
 ?column?
----------
 t

The origin seems to be a race condition on have_slrustats (https://github.com/postgres/postgres/blob/c8e1ba736b2b9e8c98d37a5b77c4ed31baf94147/src/backend/utils/activity/pgstat_slru.c#L161-L162).
I will try to get a new patch with improved test stability. 


On Mon, Jul 3, 2023 at 3:18 PM Daniel Gustafsson <daniel@yesql.se> wrote:
> On 3 Mar 2023, at 09:06, Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com> wrote:
>
> Here's the patch rebased with Andres' suggestions.
> Happy to update it if there's any additionalj change required.

This patch crashes 031_recovery_conflict with a SIGInvalid on Windows, can you
please investigate and see what might be going on there?  The test passed about
4 days ago on Windows so unless it's the CI being flaky it should be due to a
recent change.

If you don't have access to a Windows environment you can run your own
instrumented builds in your Github account with the CI files in the postgres
repo.

--
Daniel Gustafsson

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Support to define custom wait events for extensions
Next
From: Bharath Rupireddy
Date:
Subject: Re: pg_recvlogical prints bogus error when interrupted