Re: EXEC_BACKEND vs bgworkers without BGWORKER_SHMEM_ACCESS
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Robert Haas <robertmhaas@gmail.com>, PostgreSQL Development <pgsql-hackers@postgresql.org>
Date: 2021-08-05T23:09:02Z
Lists: pgsql-hackers
Hi, On 2021-08-02 15:34:07 -0400, Alvaro Herrera wrote: > Ah, that makes sense. That doesn't sound super fragile, but it is odd > and it's probably a good argument for removing the feature, particularly > since nobody seems to be using it. ISTM we concluded that we should remove unconnected workers. Writing a patch to do so left me with two questions: First, what do we want to do with BGWORKER_SHMEM_ACCESS? I'm inclined to treat it as a required flag going forward. That way we don't silently start being attached to shared memory in case somebody actually has a unattached worker. And if we ever wanted to add the ability to have unattached workers back, it'll also be easier this way. Perhaps it also has a small amount of signalling value reminding people that they need to be careful... The second question is what we want to do in the backbranches. I think the reasonable options are to do nothing, or to make !BGWORKER_SHMEM_ACCESS an error in SanityCheckBackgroundWorker() if EXEC_BACKEND is used. Greetings, Andres Freund
Commits
-
Remove support for background workers without BGWORKER_SHMEM_ACCESS.
- 80a8f95b3bca 15.0 landed
-
Detach shared memory from bgworkers without shmem access.
- 4d155d8b08fe 9.4.0 cited