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

From: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] TODO Done. Superuser backend slot reservations
Date: 2002-08-26 00:15:10
Message-ID: Pine.LNX.4.21.0208260059280.16637-100000@ponder.fairway2k.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On 25 Aug 2002, Neil Conway wrote:

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

Is -patches for discussions? I thought it was only for the patches
themselves, I'd better go subscribe...

>
> "Nigel J. Andrews" <nandrews(at)investsystems(dot)co(dot)uk> writes:
> > 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?

Well, the test is located somewhere that is only called once, when the backend
process is forked. At least that's what I think but as I say I'm not 100%
certain, mostly becuase I haven't checked only looked to see what the
routine is doing and it looks like a one shot routine to me. Therefore,
assuming doing a SET SESSION AUTH... doesn't drop and then reconnect to the
server, a change from a superuser to a normaluser is not going to result in a
dropped connection. Nor should it do I believe.

>
> + /*
> + * 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.

The warning sounds reasonable to me. I'll add one and resubmit in a day or two
after I've seen what else gets said.

--
Nigel J. Andrews

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-08-26 00:15:45 Re: Database Caching
Previous Message Nigel J. Andrews 2002-08-25 23:59:01 Re: [HACKERS] TODO Done. Superuser backend slot reservations

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2002-08-26 00:38:57 Re: [PATCHES] PostgreSQL 7.2.1 and Sun's C compiler under Solaris8
Previous Message Nigel J. Andrews 2002-08-25 23:59:01 Re: [HACKERS] TODO Done. Superuser backend slot reservations