Re: [HACKERS] Streaming replication document improvements

Fujii Masao <masao.fujii@gmail.com>

From: Fujii Masao <masao.fujii@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Josh Berkus <josh@agliodbs.com>, Kevin Grittner <Kevin.Grittner@wicourts.gov>, Tom Lane <tgl@sss.pgh.pa.us>, Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>, pgsql-docs@postgresql.org, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2010-04-20T09:47:51Z
Lists: pgsql-hackers
On Tue, Apr 20, 2010 at 11:04 AM, Robert Haas <robertmhaas@gmail.com> wrote:
> Instead of doing this, could we just change the logic in InitPostgres?
>
> Current logic says we hit the connection limit if:
>
>        if (!am_superuser &&
>                ReservedBackends > 0 &&
>                !HaveNFreeProcs(ReservedBackends))
>
> Couldn't we just change this to:
>
>        if ((!am_superuser || am_walsender) &&
>                ReservedBackends > 0 &&
>                !HaveNFreeProcs(ReservedBackends))
>
> Seems like that'd be a whole lot simpler, if it'll do the job...

It's very simple, but prevents superuser replication connection
from being established when connection limit exceeds for
non-superusers. It seems strange to me that superuser cannot use
superuser_reserved_connections slots. If we'd like to forbid
replication connection to use the slots, I think that we should
just get rid of a superuser privilege from it instead.

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center