From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove support for background workers without BGWORKER_SHMEM_ACC
Date: Fri, 13 Aug 2021 12:53:10 +0000
Message-ID: <E1mEWgQ-0003Ik-LE@gemulon.postgresql.org> (raw)
Remove support for background workers without BGWORKER_SHMEM_ACCESS.
Background workers without shared memory access have been broken on
EXEC_BACKEND / windows builds since shortly after background workers have been
introduced, without that being reported. Clearly they are not commonly used.
The problem is that bgworker startup requires to be attached to shared memory
in EXEC_BACKEND child processes. StartBackgroundWorker() detaches from shared
memory for unconnected workers, but at that point we already have initialized
subsystems referencing shared memory.
Fixing this problem is not entirely trivial, so removing the option to not be
connected to shared memory seems the best way forward. In most use cases the
advantages of being connected to shared memory far outweigh the disadvantages.
As there have been no reports about this issue so far, we have decided that it
is not worth trying to address the problem in the back branches.
Per discussion with Alvaro Herrera, Robert Haas and Tom Lane.
Author: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/20210802065116.j763tz3vz4egqy3w@alap3.anarazel.de
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/80a8f95b3bca6a80672d1766c928cda34e979112
Modified Files
--------------
doc/src/sgml/bgworker.sgml | 10 ++----
src/backend/postmaster/bgworker.c | 67 ++++++++++++++-----------------------
src/backend/postmaster/postmaster.c | 23 +++++--------
src/include/postmaster/bgworker.h | 1 +
4 files changed, 38 insertions(+), 63 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: andres@anarazel.de
Subject: Re: pgsql: Remove support for background workers without BGWORKER_SHMEM_ACC
In-Reply-To: <E1mEWgQ-0003Ik-LE@gemulon.postgresql.org>
References: <E1mEWgQ-0003Ik-LE@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox