Fix upper limit of superuser_reserved_connections, add limit for wal_senders
authorMagnus Hagander
Fri, 10 Aug 2012 12:49:03 +0000 (14:49 +0200)
committerMagnus Hagander
Fri, 10 Aug 2012 12:54:36 +0000 (14:54 +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 d8bc344b15db7a7431ae22b10d3fa1f0745a61e0..b8eaac39eaf7c587d8972571a32d9134248c2069 100644 (file)
@@ -1908,11 +1908,16 @@ SET ENABLE_SEQSCAN TO OFF;
        
        
        
-        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. wal_level must be set to archive
-        or 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
+        .  This parameter can only
+        be set at server start. wal_level must be set
+        to archive or hot_standby to allow
+        connections from standby servers.
        
        
       
index 5ae92d714005c78757127b214fa5cbb7dc129299..657dc088594b8f8fe69306cb2180140dc7e6001b 100644 (file)
@@ -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\"")));