Refactor postmaster child process launching
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 18 Mar 2024 09:35:08 +0000 (11:35 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 18 Mar 2024 09:35:30 +0000 (11:35 +0200)
commitaafc05de1bf5c0324cb5e690c6742118c1ac4af6
treec750628b17b1175e2ec4bb420275d3b6f2bced6b
parentf1baed18bc3db50c72bfb00b6247b47689158445
Refactor postmaster child process launching

Introduce new postmaster_child_launch() function that deals with the
differences in EXEC_BACKEND mode.

Refactor the mechanism of passing information from the parent to child
process. Instead of using different command-line arguments when
launching the child process in EXEC_BACKEND mode, pass a
variable-length blob of startup data along with all the global
variables. The contents of that blob depend on the kind of child
process being launched. In !EXEC_BACKEND mode, we use the same blob,
but it's simply inherited from the parent to child process.

Reviewed-by: Tristan Partin, Andres Freund
Discussion: https://www.postgresql.org/message-id/7a59b073-5b5b-151e-7ed3-8b01ff7ce9ef@iki.fi
28 files changed:
src/backend/postmaster/autovacuum.c
src/backend/postmaster/auxprocess.c
src/backend/postmaster/bgworker.c
src/backend/postmaster/bgwriter.c
src/backend/postmaster/checkpointer.c
src/backend/postmaster/launch_backend.c
src/backend/postmaster/pgarch.c
src/backend/postmaster/postmaster.c
src/backend/postmaster/startup.c
src/backend/postmaster/syslogger.c
src/backend/postmaster/walsummarizer.c
src/backend/postmaster/walwriter.c
src/backend/replication/logical/slotsync.c
src/backend/replication/walreceiver.c
src/backend/utils/init/globals.c
src/include/postmaster/autovacuum.h
src/include/postmaster/auxprocess.h
src/include/postmaster/bgworker_internals.h
src/include/postmaster/bgwriter.h
src/include/postmaster/pgarch.h
src/include/postmaster/postmaster.h
src/include/postmaster/startup.h
src/include/postmaster/syslogger.h
src/include/postmaster/walsummarizer.h
src/include/postmaster/walwriter.h
src/include/replication/slotsync.h
src/include/replication/walreceiver.h
src/tools/pgindent/typedefs.list