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

Commitfe00fec

Browse files
committed
Rename ReservedBackends variable to SuperuserReservedConnections.
This is in preparation for adding a new reserved_connections GUC,but aligning the GUC name with the variable name is also a goodidea on general principle.Patch by Nathan Bossart. Reviewed by Tushar Ahuja and by me.Discussion:http://postgr.es/m/20230119194601.GA4105788@nathanxps13
1 parent6c1d5ba commitfe00fec

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

‎src/backend/postmaster/postmaster.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,15 @@ char *Unix_socket_directories;
204204
char*ListenAddresses;
205205

206206
/*
207-
*ReservedBackends is the number of backends reserved for superuser use.
208-
* This number is taken out of the pool size given by MaxConnections so
209-
* number of backend slots available to non-superusers is
210-
* (MaxConnections -ReservedBackends). Note what this really means is
211-
* "if there are <=ReservedBackends connections available, only superusers
212-
* can make new connections" --- pre-existing superuser connections don't
213-
* count against the limit.
207+
*SuperuserReservedConnections is the number of backends reserved for
208+
*superuser use.This number is taken out of the pool size given by
209+
*MaxConnections sonumber of backend slots available to non-superusers is
210+
* (MaxConnections -SuperuserReservedConnections). Note what this really
211+
*means is"if there are <=SuperuserReservedConnections connections
212+
*available, only superuserscan make new connections" --- pre-existing
213+
*superuser connections don'tcount against the limit.
214214
*/
215-
intReservedBackends;
215+
intSuperuserReservedConnections;
216216

217217
/* The socket(s) we're listening to. */
218218
#defineMAXLISTEN64
@@ -908,11 +908,11 @@ PostmasterMain(int argc, char *argv[])
908908
/*
909909
* Check for invalid combinations of GUC settings.
910910
*/
911-
if (ReservedBackends >=MaxConnections)
911+
if (SuperuserReservedConnections >=MaxConnections)
912912
{
913913
write_stderr("%s: superuser_reserved_connections (%d) must be less than max_connections (%d)\n",
914914
progname,
915-
ReservedBackends,MaxConnections);
915+
SuperuserReservedConnections,MaxConnections);
916916
ExitPostmaster(1);
917917
}
918918
if (XLogArchiveMode>ARCHIVE_MODE_OFF&&wal_level==WAL_LEVEL_MINIMAL)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -927,8 +927,8 @@ InitPostgres(const char *in_dbname, Oid dboid,
927927
* limited by max_connections or superuser_reserved_connections.
928928
*/
929929
if (!am_superuser&& !am_walsender&&
930-
ReservedBackends>0&&
931-
!HaveNFreeProcs(ReservedBackends))
930+
SuperuserReservedConnections>0&&
931+
!HaveNFreeProcs(SuperuserReservedConnections))
932932
ereport(FATAL,
933933
(errcode(ERRCODE_TOO_MANY_CONNECTIONS),
934934
errmsg("remaining connection slots are reserved for superusers")));

‎src/backend/utils/misc/guc_tables.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2163,7 +2163,7 @@ struct config_int ConfigureNamesInt[] =
21632163
gettext_noop("Sets the number of connection slots reserved for superusers."),
21642164
NULL
21652165
},
2166-
&ReservedBackends,
2166+
&SuperuserReservedConnections,
21672167
3,0,MAX_BACKENDS,
21682168
NULL,NULL,NULL
21692169
},

‎src/include/postmaster/postmaster.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
/* GUC options */
1717
externPGDLLIMPORTboolEnableSSL;
18-
externPGDLLIMPORTintReservedBackends;
18+
externPGDLLIMPORTintSuperuserReservedConnections;
1919
externPGDLLIMPORTintPostPortNumber;
2020
externPGDLLIMPORTintUnix_socket_permissions;
2121
externPGDLLIMPORTchar*Unix_socket_group;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp