mirror of
https://github.com/postgres/postgres.git
synced 2025-05-21 15:54:08 +03:00
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
This commit is contained in:
parent
6c1d5ba486
commit
fe00fec1f5
@ -204,15 +204,15 @@ char *Unix_socket_directories;
|
|||||||
char *ListenAddresses;
|
char *ListenAddresses;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ReservedBackends is the number of backends reserved for superuser use.
|
* SuperuserReservedConnections is the number of backends reserved for
|
||||||
* This number is taken out of the pool size given by MaxConnections so
|
* superuser use. This number is taken out of the pool size given by
|
||||||
* number of backend slots available to non-superusers is
|
* MaxConnections so number of backend slots available to non-superusers is
|
||||||
* (MaxConnections - ReservedBackends). Note what this really means is
|
* (MaxConnections - SuperuserReservedConnections). Note what this really
|
||||||
* "if there are <= ReservedBackends connections available, only superusers
|
* means is "if there are <= SuperuserReservedConnections connections
|
||||||
* can make new connections" --- pre-existing superuser connections don't
|
* available, only superusers can make new connections" --- pre-existing
|
||||||
* count against the limit.
|
* superuser connections don't count against the limit.
|
||||||
*/
|
*/
|
||||||
int ReservedBackends;
|
int SuperuserReservedConnections;
|
||||||
|
|
||||||
/* The socket(s) we're listening to. */
|
/* The socket(s) we're listening to. */
|
||||||
#define MAXLISTEN 64
|
#define MAXLISTEN 64
|
||||||
@ -908,11 +908,11 @@ PostmasterMain(int argc, char *argv[])
|
|||||||
/*
|
/*
|
||||||
* Check for invalid combinations of GUC settings.
|
* Check for invalid combinations of GUC settings.
|
||||||
*/
|
*/
|
||||||
if (ReservedBackends >= MaxConnections)
|
if (SuperuserReservedConnections >= MaxConnections)
|
||||||
{
|
{
|
||||||
write_stderr("%s: superuser_reserved_connections (%d) must be less than max_connections (%d)\n",
|
write_stderr("%s: superuser_reserved_connections (%d) must be less than max_connections (%d)\n",
|
||||||
progname,
|
progname,
|
||||||
ReservedBackends, MaxConnections);
|
SuperuserReservedConnections, MaxConnections);
|
||||||
ExitPostmaster(1);
|
ExitPostmaster(1);
|
||||||
}
|
}
|
||||||
if (XLogArchiveMode > ARCHIVE_MODE_OFF && wal_level == WAL_LEVEL_MINIMAL)
|
if (XLogArchiveMode > ARCHIVE_MODE_OFF && wal_level == WAL_LEVEL_MINIMAL)
|
||||||
|
@ -927,8 +927,8 @@ InitPostgres(const char *in_dbname, Oid dboid,
|
|||||||
* limited by max_connections or superuser_reserved_connections.
|
* limited by max_connections or superuser_reserved_connections.
|
||||||
*/
|
*/
|
||||||
if (!am_superuser && !am_walsender &&
|
if (!am_superuser && !am_walsender &&
|
||||||
ReservedBackends > 0 &&
|
SuperuserReservedConnections > 0 &&
|
||||||
!HaveNFreeProcs(ReservedBackends))
|
!HaveNFreeProcs(SuperuserReservedConnections))
|
||||||
ereport(FATAL,
|
ereport(FATAL,
|
||||||
(errcode(ERRCODE_TOO_MANY_CONNECTIONS),
|
(errcode(ERRCODE_TOO_MANY_CONNECTIONS),
|
||||||
errmsg("remaining connection slots are reserved for superusers")));
|
errmsg("remaining connection slots are reserved for superusers")));
|
||||||
|
@ -2163,7 +2163,7 @@ struct config_int ConfigureNamesInt[] =
|
|||||||
gettext_noop("Sets the number of connection slots reserved for superusers."),
|
gettext_noop("Sets the number of connection slots reserved for superusers."),
|
||||||
NULL
|
NULL
|
||||||
},
|
},
|
||||||
&ReservedBackends,
|
&SuperuserReservedConnections,
|
||||||
3, 0, MAX_BACKENDS,
|
3, 0, MAX_BACKENDS,
|
||||||
NULL, NULL, NULL
|
NULL, NULL, NULL
|
||||||
},
|
},
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
/* GUC options */
|
/* GUC options */
|
||||||
extern PGDLLIMPORT bool EnableSSL;
|
extern PGDLLIMPORT bool EnableSSL;
|
||||||
extern PGDLLIMPORT int ReservedBackends;
|
extern PGDLLIMPORT int SuperuserReservedConnections;
|
||||||
extern PGDLLIMPORT int PostPortNumber;
|
extern PGDLLIMPORT int PostPortNumber;
|
||||||
extern PGDLLIMPORT int Unix_socket_permissions;
|
extern PGDLLIMPORT int Unix_socket_permissions;
|
||||||
extern PGDLLIMPORT char *Unix_socket_group;
|
extern PGDLLIMPORT char *Unix_socket_group;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user