Re: [PATCH] pgstat: Add helper to drop entries from a stats kind's hash

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Sami Imseih <samimseih(dot)pg(at)gmail(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] pgstat: Add helper to drop entries from a stats kind's hash
Date: 2026-11-02 07:18:00
Message-ID: aug5KH7bFtEzh1ia@bdtpg
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Mon, Nov 02, 2026 at 09:35:50AM +0900, Michael Paquier wrote:
> On Fri, Oct 30, 2026 at 09:41:12AM -0500, Sami Imseih wrote:
> > v5 now has these pgstat_drop_matching_entries() cases:
> >
> > 1. Specific kind + non-NULL callback
> > 2. All kinds + non-NULL callback (similar to the injection points test
> > functionally)
> > 3. Specific kind + NULL callback
>
> The NULL callback case is already covered by the in-core code, for
> example where we drop all the entries during a reset. I don't see a
> specific need for more coverage with this pattern.

Agreed.

> Hmmm... Indeed... We used to have a pgstat_drop_matching_entries()
> call that we have dropped when moving these tests from
> injection_points to test_custom_stats. That was not intentional.

Yeah, looks like an oversight.

> I think that your test_custom_stats_var_drop_all() makes sense, with
> a callback that matches with the variable-sized kind ID. This should
> be backpatched down to v19, perhaps, but I'm mild with playing with
> this stable branch as we are close to release. And this is just for a
> small gap in the tests.

> Anyway, what do you think about the attached to address this hole in
> the tests?

LGTM and I don't see a strong case for backpatching.

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Borodin 2026-11-02 07:36:42 Re: 007_pre_auth.pl fails if injection_points_wakeup hits unintended process
Previous Message Michael Paquier 2026-11-02 07:08:13 Re: 007_pre_auth.pl fails if injection_points_wakeup hits unintended process