Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5ecd018

Browse files
committed
Fix comments about bgworker registration before MaxBackends initialization
Since6bc8ef0, InitializeMaxBackends() has used max_worker_processesinstead of adapting MaxBackends to the number of background workersregistered by modules loaded in shared_preload_libraries (at this time,bgworkers were only static, but gained dynamic capabilities as a matterof supporting parallel queries meaning that a control cap wasnecessary).Some comments referred to the past registration logic, making themconfusing and incorrect, so fix these.Some of the out-of-core modules that could be loaded in this pathsometimes like to manipulate dynamically some of the resource-relatedGUCs for their own needs, this commit adds a note about that.Author: Nathan BossartDiscussion:https://postgr.es/m/20220127181815.GA551692@nathanxps13
1 parentbf42fca commit5ecd018

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

‎src/backend/postmaster/postmaster.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,10 +1014,8 @@ PostmasterMain(int argc, char *argv[])
10141014
LocalProcessControlFile(false);
10151015

10161016
/*
1017-
* Register the apply launcher. Since it registers a background worker,
1018-
* it needs to be called before InitializeMaxBackends(), and it's probably
1019-
* a good idea to call it before any modules had chance to take the
1020-
* background worker slots.
1017+
* Register the apply launcher. It's probably a good idea to call this
1018+
* before any modules had a chance to take the background worker slots.
10211019
*/
10221020
ApplyLauncherRegister();
10231021

@@ -1038,8 +1036,8 @@ PostmasterMain(int argc, char *argv[])
10381036
#endif
10391037

10401038
/*
1041-
* Now that loadable modules have had their chance toregister background
1042-
*workers,calculate MaxBackends.
1039+
* Now that loadable modules have had their chance toalter any GUCs,
1040+
* calculate MaxBackends.
10431041
*/
10441042
InitializeMaxBackends();
10451043

‎src/backend/utils/init/postinit.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,8 @@ pg_split_opts(char **argv, int *argcp, const char *optstr)
483483
/*
484484
* Initialize MaxBackends value from config options.
485485
*
486-
* This must be called after modules have had the chance to register background
487-
* workers in shared_preload_libraries, and before shared memory size is
488-
* determined.
486+
* This must be called after modules have had the chance to alter GUCs in
487+
* shared_preload_libraries and before shared memory size is determined.
489488
*
490489
* Note that in EXEC_BACKEND environment, the value is passed down from
491490
* postmaster to subprocesses via BackendParameters in SubPostmasterMain; only

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp