Re: Support worker_spi to execute the function dynamically.

From: Masahiro Ikeda <ikedamsh(at)oss(dot)nttdata(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Support worker_spi to execute the function dynamically.
Date: 2023-07-20 08:54:55
Message-ID: 36c787d791450b21dfb64f1b31474d76@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2023-07-20 12:55, Michael Paquier wrote:
> On Thu, Jul 20, 2023 at 11:15:51AM +0900, Masahiro Ikeda wrote:
>> While I'm working on the thread[1], I found that the function of
>> worker_spi module fails if 'shared_preload_libraries' doesn't have
>> worker_spi.
>
> I guess that you were patching worker_spi to register dynamically a
> wait event and embed that in a TAP test or similar without loading it
> in shared_preload_libraries? FWIW, you could use a trick like what I
> am attaching here to load a wait event dynamically with the custom
> wait event API. You would need to make worker_spi_init_shmem() a bit
> more aggressive with an extra hook to reserve a shmem area size, but
> that's enough to show the custom wait event in the same backend as the
> one that launches a worker_spi dynamically, while demonstrating how
> the API can be used in this case.

Yes, you're right. When I tried using worker_spi to test wait event,
I found the behavior. And thanks a lot for your patch. I wasn't aware
of the way. I'll merge your patch to the tests for wait events.

Regards,
--
Masahiro Ikeda
NTT DATA CORPORATION

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiro Ikeda 2023-07-20 09:08:04 Re: Support worker_spi to execute the function dynamically.
Previous Message Melih Mutlu 2023-07-20 08:38:02 Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication