Re: BUG #16914: Regression test of the worker_spi fails if USE_MODULE_DB environment variable is set.

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, r(dot)zharkov(at)postgrespro(dot)ru, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16914: Regression test of the worker_spi fails if USE_MODULE_DB environment variable is set.
Date: 2021-03-05 05:30:20
Message-ID: YEHB7A2c+qzpZ2+J@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Mar 04, 2021 at 05:14:57PM -0500, Tom Lane wrote:
> CREATE EXTENSION worker_spi;
> +SELECT set_config('worker_spi.database', current_database(), false);
> SELECT worker_spi_launch(4) IS NOT NULL;
> -- wait until the worker completes its initialization
>
> but that doesn't work because the session-local setting of the GUC won't
> be seen over in the worker process.
>
> Since the alleged point of this module is to be a prototype for
> useful background workers, I think we should think of another way.
> Maybe we need to work a bit harder on passing values from
> worker_spi_launch to the worker, so that the DB name could be a
> parameter to worker_spi_launch.

Yeah, or this is converted to a TAP test where we don't care about
the database used, but that would consume more cycles without more
coverage done. Don't we need to worry about the memory context where
bgw_main_arg is pushed into for dynamic workers?
--
Michael

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2021-03-05 05:42:43 Re: BUG #16914: Regression test of the worker_spi fails if USE_MODULE_DB environment variable is set.
Previous Message Michael Paquier 2021-03-05 04:32:47 Re: BUG #16894: PANIC: WAL contains references to invalid pages