Re: [HACKERS] TODO Done. Superuser backend slot reservations

From: Neil Conway <neilc(at)samurai(dot)com>
To: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] TODO Done. Superuser backend slot reservations
Date: 2002-08-25 23:26:06
Message-ID: 87k7me8qr5.fsf@mailbox.samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

[only replying to -patches, this doesn't belong on -hackers AFAICS ]

"Nigel J. Andrews" <nandrews(at)investsystems(dot)co(dot)uk> writes:
> Added GUC superuser_reserved_connections such that non-superuser connections
> are only acceptable in the first
> (max_connections - superuser_reserved_connections) backend slots.

I'd prefer that we not change the meaning of max_connections. I had in
mind the following:

- max_connections denotes the # of "regular" connections to
the database (i.e. admin & non-admin)
- max_admin_connections denotes an additional # of backend
slots that are reserved for connections from superusers. Not
sure if this should default to zero or not
- Therefore, the # of backend slots created is
(max_connections + max_admin_connections)

> In addition, this limit is only checked on initialisation of a backend
> process. So reserved slots can be taken by connections that subsequently
> lose superuser priviledges thus evading the lower limit on backends.

How can that happen?

+ /*
+ * Force ReservedBackends is less than MaxBackends if need be.
+ * A cluster only allowing superuser connections seems silly whereas
+ * a cluster reserving none for superusers doesn't.
+ */
+ if (ReservedBackends >= MaxBackends)
+ ReservedBackends = MaxBackends - 1;

IMHO, we should elog(FATAL) here, or at least emit a warning.

Cheers,

Neil

--
Neil Conway <neilc(at)samurai(dot)com> || PGP Key ID: DB3C29FC

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-08-25 23:31:13 Re: [HACKERS] TODO Done. Superuser backend slot reservations
Previous Message Nigel J. Andrews 2002-08-25 22:56:31 TODO Done. Superuser backend slot reservations

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2002-08-25 23:31:13 Re: [HACKERS] TODO Done. Superuser backend slot reservations
Previous Message Nigel J. Andrews 2002-08-25 22:56:31 TODO Done. Superuser backend slot reservations