Skip site navigation (1) Skip section navigation (2)

Re: don't allow walsender to consume superuser_reserved_connection slots, or during shutdown

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: don't allow walsender to consume superuser_reserved_connection slots, or during shutdown
Date: 2010-04-22 02:27:26
Message-ID: w2q3f0b79eb1004211927v283a3706ubd35c8bc608199d@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Thu, Apr 22, 2010 at 11:01 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> Here's the fine patch.  The actual code changes are simple and seem to
>> work as expected, but I struggled a bit with the phrasing of the
>> messages.  Feel free to suggest improvements.
>
> Stick with the original wording?  I don't really see a need to change it.

How about?:

if ((!am_superuser || am_walsender) &&
	ReservedBackends > 0 &&
	!HaveNFreeProcs(ReservedBackends))
{
	if (am_walsender)
		ereport(FATAL,
			(errcode(ERRCODE_TOO_MANY_CONNECTIONS),
			 errmsg("remaining connection slots are reserved for
non-replication superuser connections")));
	else
		ereport(FATAL,
			(errcode(ERRCODE_TOO_MANY_CONNECTIONS),
			 errmsg("connection limit exceeded for non-superusers")));
}

Regards,

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

In response to

pgsql-hackers by date

Next:From: Jeff DavisDate: 2010-04-22 02:36:00
Subject: Re: extended operator classes vs. type interfaces
Previous:From: Tom LaneDate: 2010-04-22 02:01:17
Subject: Re: don't allow walsender to consume superuser_reserved_connection slots, or during shutdown

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group