summaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
authorTom Lane2018-03-08 16:25:26 +0000
committerTom Lane2018-03-08 16:25:26 +0000
commit4e0c743c18bf5435a4850510c5c74b3521c3e1e5 (patch)
tree548ba5c052c971a450f9f0bc5db10521b9946a69 /src/backend/utils
parentf9f8784c8b3050aaec52da88a6e41b3e3f576b96 (diff)
Fix cross-checking of ReservedBackends/max_wal_senders/MaxConnections.
We were independently checking ReservedBackends < MaxConnections and max_wal_senders < MaxConnections, but because walsenders aren't allowed to use superuser-reserved connections, that's really the wrong thing. Correct behavior is to insist on ReservedBackends + max_wal_senders being less than MaxConnections. Fix the code and associated documentation. This has been wrong for a long time, but since the situation probably hardly ever arises in the field (especially pre-v10, when the default for max_wal_senders was zero), no back-patch. Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/init/postinit.c2
-rw-r--r--src/backend/utils/misc/guc.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c
index 484628987f4..d8f45b3c43f 100644
--- a/src/backend/utils/init/postinit.c
+++ b/src/backend/utils/init/postinit.c
@@ -778,7 +778,7 @@ InitPostgres(const char *in_dbname, Oid dboid, const char *username,
}
/*
- * The last few connections slots are reserved for superusers. Although
+ * The last few connection slots are reserved for superusers. Although
* replication connections currently require superuser privileges, we
* don't allow them to consume the reserved slots, which are intended for
* interactive use.
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 0c4cc9160d4..a4f9b3668e0 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -1873,6 +1873,7 @@ static struct config_int ConfigureNamesInt[] =
},
{
+ /* see max_connections and max_wal_senders */
{"superuser_reserved_connections", PGC_POSTMASTER, CONN_AUTH_SETTINGS,
gettext_noop("Sets the number of connection slots reserved for superusers."),
NULL
@@ -2375,7 +2376,7 @@ static struct config_int ConfigureNamesInt[] =
},
{
- /* see max_connections */
+ /* see max_connections and superuser_reserved_connections */
{"max_wal_senders", PGC_POSTMASTER, REPLICATION_SENDING,
gettext_noop("Sets the maximum number of simultaneously running WAL sender processes."),
NULL
@@ -2386,7 +2387,7 @@ static struct config_int ConfigureNamesInt[] =
},
{
- /* see max_connections */
+ /* see max_wal_senders */
{"max_replication_slots", PGC_POSTMASTER, REPLICATION_SENDING,
gettext_noop("Sets the maximum number of simultaneously defined replication slots."),
NULL