From: Tom Lane <tgl@sss.pgh.pa.us>
To: Magnus Hagander <magnus@hagander.net>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Ashesh Vashi <ashesh.vashi@enterprisedb.com>
Cc: Mark Llewellyn <mark_llewellyn@adp.com>
Cc: pgsql-hackers@postgresql.org
Cc: Sujeet Rajguru <sujeet.rajguru@enterprisedb.com>
Subject: Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running
Date: Wed, 17 Nov 2010 14:21:44 -0500
Message-ID: <17545.1290021704@sss.pgh.pa.us> (raw)
In-Reply-To: <AANLkTikB7YUtrLzZpYW_1sogTncrTc5GOTDxh8hC_mjB@mail.gmail.com>
References: <AANLkTikoguB88dO125RfPHzOu0vrhLc88WyGerDChhWK@mail.gmail.com>
<201011171857.oAHIvJr19227@momjian.us>
<AANLkTikB7YUtrLzZpYW_1sogTncrTc5GOTDxh8hC_mjB@mail.gmail.com>
Magnus Hagander <magnus@hagander.net> writes:
> On Wed, Nov 17, 2010 at 19:57, Bruce Momjian <bruce@momjian.us> wrote:
>> Is FATAL, in general, enough to conclude the server is running?
> No - specifically, we will send FATAL when "the database system is
> starting up", which is exactly the one we want to *avoid*.
> I think we should only exclude the password case. I guess we could
> also do all fatal *except* <list>, but that seems more fragile.
I believe that the above argument is exactly backwards. What we want
here is to check the result of postmaster.c's canAcceptConnections(),
and there are only a finite number of error codes that can result from
rejections there. If we get past that, there are a large number of
possible failures, but all of them indicate that the postmaster is in
principle willing to accept connections. Checking for password errors
only is utterly wrong: any other type of auth failure would be the same
for this purpose, as would "no such database", "no such user", "too many
connections", etc etc etc.
What we actually want here, and don't have, is the fabled pg_ping
protocol...
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, magnus@hagander.net, bruce@momjian.us, ashesh.vashi@enterprisedb.com, mark_llewellyn@adp.com, pgsql-hackers@postgresql.org, sujeet.rajguru@enterprisedb.com
Subject: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running
In-Reply-To: <17545.1290021704@sss.pgh.pa.us>
References: <AANLkTikoguB88dO125RfPHzOu0vrhLc88WyGerDChhWK@mail.gmail.com> <201011171857.oAHIvJr19227@momjian.us> <AANLkTikB7YUtrLzZpYW_1sogTncrTc5GOTDxh8hC_mjB@mail.gmail.com> <17545.1290021704@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox