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

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: [HACKERS] TODO Done. Superuser backend slot reservations
Дата
Msg-id 87k7me8qr5.fsf@mailbox.samurai.com
обсуждение исходный текст
Ответы Re: [HACKERS] TODO Done. Superuser backend slot reservations  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: [HACKERS] TODO Done. Superuser backend slot reservations  ("Nigel J. Andrews" <nandrews@investsystems.co.uk>)
Re: [HACKERS] TODO Done. Superuser backend slot reservations  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
[only replying to -patches, this doesn't belong on -hackers AFAICS ]

"Nigel J. Andrews" <nandrews@investsystems.co.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@samurai.com> || PGP Key ID: DB3C29FC

В списке pgsql-patches по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: make interfaces/perl5 build properly outside source directory
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] TODO Done. Superuser backend slot reservations