Re: EXEC_BACKEND vs bgworkers without BGWORKER_SHMEM_ACCESS
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Andres Freund <andres@anarazel.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Robert Haas <robertmhaas@gmail.com>, PostgreSQL Development <pgsql-hackers@postgresql.org>
Date: 2021-08-02T19:12:49Z
Lists: pgsql-hackers
On 2021-Aug-02, Andres Freund wrote: > > When I included this case I was thinking in tasks which would just run > > stuff not directly connected to data. Something like a sub-daemon: say > > a connection pooler, which is a bgworker just so that it starts and > > stops together with postmaster, and share facilities like GUC > > configuration and SIGHUP handling, etc. > > I think nearly all such cases are going to want some monitoring from > within the database - which then needs shared memory. True. Observability for such things is critical (pgbouncer goes quite some trouble to offer SQL-queryable views into its metrics), which kills the argument. > I do think there's some potential gains in simplicity and robustness > that are made mildly harder by a subprocess that first attaches and > detaches from shm (it's the only case where we can't easily unify the > place InitProcess() is called between EB and ! EB right now). There's > several ways that could be tackled. Removing the need to have that if > obviously one of them. Hmm, I don't remember that an shmem-unconnected bgworker first connected to it and then let go. It seems weird to do it that way. My intention, as far as I recall, is that they would just never connect to shmem, period. -- Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/ "I think my standards have lowered enough that now I think 'good design' is when the page doesn't irritate the living f*ck out of me." (JWZ)
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