Re: Support worker_spi to execute the function dynamically.

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Support worker_spi to execute the function dynamically.
Дата
Msg-id ZLiwP5vrT/SENzim@paquier.xyz
обсуждение исходный текст
Ответ на Support worker_spi to execute the function dynamically.  (Masahiro Ikeda <ikedamsh@oss.nttdata.com>)
Ответы Re: Support worker_spi to execute the function dynamically.  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Re: Support worker_spi to execute the function dynamically.  (Masahiro Ikeda <ikedamsh@oss.nttdata.com>)
Список pgsql-hackers
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.

> In my understanding, the restriction is not required. So, I think it's
> better to change the behavior.
> (v1-0001-Support-worker_spi-to-execute-the-function-dynamical.patch)
>
> What do you think?

+1.  I'm OK to lift this restriction with a SIGHUP GUC for the
database name and that's not a pattern to encourage in a template
module.  Will do so, if there are no objections.
--
Michael

Вложения

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

Предыдущее
От: Gurjeet Singh
Дата:
Сообщение: Re: Issue in _bt_getrootheight
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication