Bugs in superuser_reserved_connections and max_wal_senders vs max_connections

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Bugs in superuser_reserved_connections and max_wal_senders vs max_connections
Date: 2012-08-09 10:10:21
Message-ID: CABUevEwm4KjR6N1O4N9_SU0Tkxujigj7oO2Ug2OvbXo_G9EFNQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Both superuser_reserved_connections and max_wal_senders can be set to
a value that's higher than max_connections, which is quite pointless,
and annoying :)

The docs for superuser_reserved_connections say "The value must be
less than the value of max_connections.", but this is never enforced.
Well, it's strangely enfocred. With max_connections=100, I can set
superuser_reserved_connections to 103. Looks like this is caused by
autovacuum_max_workers - because if I increase that one to 4, then I
can get it up to104...

The check in PostmasterMain():
if (ReservedBackends >= MaxBackends)
{
write_stderr("%s: superuser_reserved_connections must be less than
max_connections\n", progname);
ExitPostmaster(1);
}

should probably check against MaxConnections instead of MaxBackends, I think?

The docs for max_wal_senders say nothing at all about the relation to
max_connections, which it really should. And it should probably be
enforced the same way that superuser_reserved_connections is, so you
can't set it to silly high values.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2012-08-09 10:14:33 Re: patch submission: truncate trailing nulls from heap rows to reduce the size of the null bitmap
Previous Message Jan Urbański 2012-08-09 09:55:00 Re: Re: [COMMITTERS] pgsql: Fix mapping of PostgreSQL encodings to Python encodings.