git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: bb86141) | patch
Assign a child slot to every postmaster child process
2024年11月14日 14:12:28 +0000 (16:12 +0200)
2024年11月14日 14:12:28 +0000 (16:12 +0200)
commit a78af0427015449269fb7d9d8c6057cfcb740149
Assign a child slot to every postmaster child process

Previously, only backends, autovacuum workers, and background workers
had an entry in the PMChildFlags array. With this commit, all
postmaster child processes, including all the aux processes, have an
entry. Dead-end backends still don't get an entry, though, and other
processes that don't touch shared memory will never mark their
PMChildFlags entry as active.

We now maintain separate freelists for different kinds of child
processes. That ensures that there are always slots available for
autovacuum and background workers. Previously, pre-authentication
backends could prevent autovacuum or background workers from starting
up, by using up all the slots.

The code to manage the slots in the postmaster process is in a new
pmchild.c source file. Because postmaster.c is just so large.
Assigning pmsignal slot numbers is now pmchild.c's responsibility.
This replaces the PMChildInUse array in pmsignal.c.

Some of the comments in postmaster.c still talked about the "stats
process", but that was removed in commit 5891c7a8ed. Fix those while
we're at it.

Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://www.postgresql.org/message-id/a102f15f-eac4-4ff2-af02-f9ff209ec66f@iki.fi
15 files changed:
src/backend/bootstrap/bootstrap.c diff | blob | blame | history
src/backend/postmaster/Makefile diff | blob | blame | history
src/backend/postmaster/launch_backend.c diff | blob | blame | history
src/backend/postmaster/meson.build diff | blob | blame | history
src/backend/postmaster/pmchild.c [new file with mode: 0644] blob
src/backend/postmaster/postmaster.c diff | blob | blame | history
src/backend/postmaster/syslogger.c diff | blob | blame | history
src/backend/storage/ipc/pmsignal.c diff | blob | blame | history
src/backend/storage/lmgr/proc.c diff | blob | blame | history
src/backend/tcop/postgres.c diff | blob | blame | history
src/include/postmaster/bgworker_internals.h diff | blob | blame | history
src/include/postmaster/postmaster.h diff | blob | blame | history
src/include/postmaster/syslogger.h diff | blob | blame | history
src/include/storage/pmsignal.h diff | blob | blame | history
src/tools/pgindent/typedefs.list diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /