Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Fix upper limit of superuser_reserved_connections, add limit for wal_senders
authorMagnus Hagander <magnus@hagander.net>
Fri, 10 Aug 2012 12:49:03 +0000 (14:49 +0200)
committerMagnus Hagander <magnus@hagander.net>
Fri, 10 Aug 2012 12:52:16 +0000 (14:52 +0200)
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.

doc/src/sgml/config.sgml
src/backend/postmaster/postmaster.c

index 1d359dacb3d9cb406d8123e37f8504d25e39f1cb..bf4fb001379b84af421da4bffd9825d15d08f636 100644 (file)
@@ -1966,12 +1966,16 @@ SET ENABLE_SEQSCAN TO OFF;
        </indexterm>
        <listitem>
        <para>
-        Specifies the maximum number of concurrent connections from standby
-        servers or streaming base backup clients (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 or streaming base backup clients (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>
index ea2784d608389bbc28adf92111b5a7305e5e64f4..8b181824d2effbf75c9dc8c81b9158cfddcc99f0 100644 (file)
@@ -731,11 +731,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\"")));