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

Поиск
Список
Период
Сортировка
От Bertrand Drouvot
Тема Re: Fix locking issue with fixed-size stats template in injection_points
Дата
Msg-id aNosr8ntXePfFlSF@ip-10-97-1-34.eu-west-3.compute.internal
обсуждение исходный текст
Ответ на Fix locking issue with fixed-size stats template in injection_points  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: Fix locking issue with fixed-size stats template in injection_points
Список pgsql-hackers
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,100000)
> select injection_points_attach('popo:id', 'notice');
> select injection_points_run('popo:id');
> select injection_points_detach('popo:id');
> $ pgbench -n -T 300 -f create_inj.sql -c 10
> 
> 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, bgwriter, checkpointer).  So this is just a
> matter of acquiring a lock that was forgotten, to make sure that the
> changes are consistent.  Far from critical as this is template code,
> still embarrassing.
> 
> Thoughts or comments?

Patch LGTM.

Remark: I like the "popo" prefix in your test ;-)

Regards,

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



В списке pgsql-hackers по дате отправления: