Re: Injection points: some tools to wait and wake - Mailing list pgsql-hackers

From Andrey M. Borodin
Subject Re: Injection points: some tools to wait and wake
Date
Msg-id 19DE6301-C7C1-44C3-AB23-9574CD8C0579@yandex-team.ru
Whole thread Raw
In response to Re: Injection points: some tools to wait and wake  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Injection points: some tools to wait and wake
List pgsql-hackers

> On 26 Feb 2024, at 08:57, Michael Paquier <michael@paquier.xyz> wrote:
>
> <v4-0001-injection_points-Add-routines-to-wait-and-wake-pr.patch>

Would it be possible to have a helper function to check this:

+ok( $node_standby->poll_query_until(
+        'postgres',
+        qq[SELECT count(*) FROM pg_stat_activity
+           WHERE backend_type = 'checkpointer' AND wait_event = 'CreateRestartPoint' ;],
+        '1'),
+    'checkpointer is waiting in restart point'
+) or die "Timed out while waiting for checkpointer to run restart point”;

So that we could do something like

ok(node_standby->await_injection_point(“CreateRestartPoint”,”checkpointer"));

IMO, this could make many tests cleaner.
Or, perhaps, it’s a functionality for a future development?

Thanks!


Best regards, Andrey Borodin.


pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Optimize planner memory consumption for huge arrays
Next
From: Bertrand Drouvot
Date:
Subject: Re: Documentation: warn about two_phase when altering a subscription