aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Hagander <magnus@hagander.net>2012-08-10 14:49:03 +0200
committerMagnus Hagander <magnus@hagander.net>2012-08-10 14:54:36 +0200
commit6f0c9bc4b95c295501caa5ca56158afef7f50f30 (patch)
treedadd1b45e46b2b76e649aca714685d694e79c54a
parentc0751d323e96fcaaecba289b71970388972ee608 (diff)
downloadpostgresql-6f0c9bc4b95c295501caa5ca56158afef7f50f30.tar.gz
postgresql-6f0c9bc4b95c295501caa5ca56158afef7f50f30.zip
Fix upper limit of superuser_reserved_connections, add limit for wal_senders
Should be limited to the maximum number of connections excluding autovacuum workers, not including. Add similar check for max_wal_senders, which should never be higher than max_connections.
-rw-r--r--doc/src/sgml/config.sgml15
-rw-r--r--src/backend/postmaster/postmaster.c7
2 files changed, 16 insertions, 6 deletions
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index d8bc344b15d..b8eaac39eaf 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -1908,11 +1908,16 @@ SET ENABLE_SEQSCAN TO OFF;
</indexterm>
<listitem>
<para>
- Specifies the maximum number of concurrent connections from standby
- servers (i.e., the maximum number of simultaneously running WAL sender
- processes). The default is zero. This parameter can only be set at
- server start. <varname>wal_level</> must be set to <literal>archive</>
- or <literal>hot_standby</> to allow connections from standby servers.
+ Specifies the maximum number of concurrent connections from
+ standby servers (i.e., the
+ maximum number of simultaneously running WAL sender
+ processes). The default is zero, meaning replication is
+ disabled. WAL sender processes count towards the total number
+ of connections, so the parameter cannot be set higher than
+ <xref linkend="guc-max-connections">. This parameter can only
+ be set at server start. <varname>wal_level</> must be set
+ to <literal>archive</> or <literal>hot_standby</> to allow
+ connections from standby servers.
</para>
</listitem>
</varlistentry>
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 5ae92d71400..657dc088594 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -724,11 +724,16 @@ PostmasterMain(int argc, char *argv[])
/*
* Check for invalid combinations of GUC settings.
*/
- if (ReservedBackends >= MaxBackends)
+ if (ReservedBackends >= MaxConnections)
{
write_stderr("%s: superuser_reserved_connections must be less than max_connections\n", progname);
ExitPostmaster(1);
}
+ if (max_wal_senders >= MaxConnections)
+ {
+ write_stderr("%s: max_wal_senders must be less than max_connections\n", progname);
+ ExitPostmaster(1);
+ }
if (XLogArchiveMode && wal_level == WAL_LEVEL_MINIMAL)
ereport(ERROR,
(errmsg("WAL archival (archive_mode=on) requires wal_level \"archive\" or \"hot_standby\"")));