Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit fe00fec

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 good idea on general principle. Patch by Nathan Bossart. Reviewed by Tushar Ahuja and by me. Discussion: http://postgr.es/m/20230119194601.GA4105788@nathanxps13
1 parent 6c1d5ba commit fe00fec

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/backend/postmaster/postmaster.c

+10-10
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 so number 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 superusers can make new connections" --- pre-existing
213+
* superuser connections don't count against the limit.
214214
*/
215-
int ReservedBackends;
215+
int SuperuserReservedConnections;
216216

217217
/* The socket(s) we're listening to. */
218218
#define MAXLISTEN 64
@@ -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

+2-2
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

+1-1
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
/* GUC options */
1717
extern PGDLLIMPORT bool EnableSSL;
18-
extern PGDLLIMPORT int ReservedBackends;
18+
extern PGDLLIMPORT int SuperuserReservedConnections;
1919
extern PGDLLIMPORT int PostPortNumber;
2020
extern PGDLLIMPORT int Unix_socket_permissions;
2121
extern PGDLLIMPORT char *Unix_socket_group;

0 commit comments

Comments
 (0)