Re: pg_reload_conf() synchronously - Mailing list pgsql-hackers

From Andres Freund
Subject Re: pg_reload_conf() synchronously
Date
Msg-id 20221105024630.ca3tadl5ghxbpaxh@awork3.anarazel.de
Whole thread Raw
In response to pg_reload_conf() synchronously  (Gurjeet Singh <gurjeet@singh.im>)
Responses Re: pg_reload_conf() synchronously
List pgsql-hackers
Hi,

On 2022-11-04 10:26:38 -0700, Gurjeet Singh wrote:
> The attached patch makes the pg_reload_conf() function set
> ConfigReloadPending to true, which will force the postgres main
> command-processing loop to process and apply config changes _before_
> executing the next command.

Worth noting that this doesn't necessarily suffice to avoid race conditions in
tests, if the test depends on *other* backends having seen the configuration
changes.

It might be worth to use the global barrier mechanism to count which backends
have reloaded configuration and to provide a function / option to pg_sleep
that waits for that.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Add tracking of backend memory allocated to pg_stat_activity
Next
From: Michael Paquier
Date:
Subject: Re: Incorrect include file order in guc-file.l