Re: Fix locking issue with fixed-size stats template in injection_points

2025-10-18 Thread Chao Li
> On Sep 29, 2025, at 08:48, Michael Paquier wrote: > > > The failure is not surprising, because the stats reports can happen in > a concurrent fashion when a point is run for example, contrary to > other fixed-sized stats kind where the reports are only done by a > single process (archiver, b

Re: Fix locking issue with fixed-size stats template in injection_points

2025-10-18 Thread Michael Paquier
On Mon, Sep 29, 2025 at 09:46:05AM +0800, Chao Li wrote: > I saw pg_state_begin_changecount_write() is called multiple places, > as you mention, for example bgwriter. I've mentioned that in my first email, and put in details: - pgstat_report_bgwriter() is called once, by the bgwriter. - pgstat_rep

Re: Fix locking issue with fixed-size stats template in injection_points

2025-10-18 Thread Michael Paquier
On Mon, Sep 29, 2025 at 05:01:37PM +0900, Michael Paquier wrote: > It's that or popopop. "glop" and "pas-glop" were my other candidates, > but I doubt we can use them freely, and you may be the only one around > here to know what this refers to. :D Putting that aside, fixed down to v18. -- Micha

Re: Fix locking issue with fixed-size stats template in injection_points

2025-10-18 Thread Chao Li
> On Sep 29, 2025, at 14:27, Michael Paquier wrote: > > On Mon, Sep 29, 2025 at 09:46:05AM +0800, Chao Li wrote: >> I saw pg_state_begin_changecount_write() is called multiple places, >> as you mention, for example bgwriter. > > I've mentioned that in my first email, and put in details: > - pg

Re: Fix locking issue with fixed-size stats template in injection_points

2025-10-17 Thread wenhui qiu
HI This patch looks good to me. The issue is clear: unlike other fixed-size stats kinds (archiver, bgwriter, checkpointer), the injection_points stats can be updated concurrently by multiple backends. Without synchronization, this can lead to inconsistent changecount state and assertion failures i

Re: Fix locking issue with fixed-size stats template in injection_points

2025-10-02 Thread Bertrand Drouvot
Hi, On Mon, Sep 29, 2025 at 09:48:44AM +0900, Michael Paquier wrote: > Then something like the following command: > $ cat create_inj.sql > \set id random(1,10) > select injection_points_attach('popo:id', 'notice'); > select injection_points_run('popo:id'); > select injection_points_detach('pop

Re: Fix locking issue with fixed-size stats template in injection_points

2025-10-02 Thread Michael Paquier
On Mon, Sep 29, 2025 at 06:52:31AM +, Bertrand Drouvot wrote: > Remark: I like the "popo" prefix in your test ;-) It's that or popopop. "glop" and "pas-glop" were my other candidates, but I doubt we can use them freely, and you may be the only one around here to know what this refers to. :D