Re: Support worker_spi to execute the function dynamically.

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Masahiro Ikeda <ikedamsh(at)oss(dot)nttdata(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Support worker_spi to execute the function dynamically.
Date: 2023-07-21 05:54:08
Message-ID: CALj2ACVUxgcQaGh3HpBJ6Xg9FRqj7UNDomd5E1y=tRKs2wcntA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 21, 2023 at 8:38 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Thu, Jul 20, 2023 at 03:44:12PM +0530, Bharath Rupireddy wrote:
> > I don't think that change is correct. The worker_spi essentially shows
> > how to start bg workers with RegisterBackgroundWorker and dynamic bg
> > workers with RegisterDynamicBackgroundWorker. If
> > shared_preload_libraries = worker_spi not specified in there, you will
> > miss to start RegisterBackgroundWorkers. Is giving an initidb time
> > database name to worker_spi.database work there? If the database for
> > bg workers doesn't exist, changing bgw_restart_time from
> > BGW_NEVER_RESTART to say 1 will help to see bg workers coming up
> > eventually.
>
> Yeah, it does not move the needle by much. I think that we are
> looking at switching this module to use a TAP test in the long term,
> instead, where it would be possible to test the scenarios we want to
> look at *with* and *without* shared_preload_libraries especially with
> the custom wait events for extensions in mind if we add our tests in
> this module.

Okay. Here's a quick patch for adding TAP tests to the worker_spi
module. We can change it to taste.

Thoughts?

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

Attachment Content-Type Size
v1-0001-Add-TAP-tests-to-worker_spi-module.patch application/octet-stream 5.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2023-07-21 05:59:17 Re: WAL Insertion Lock Improvements
Previous Message Amit Kapila 2023-07-21 05:39:22 Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication