From: Bruce Momjian <bruce@momjian.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Magnus Hagander <magnus@hagander.net>
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 21:54:33 -0500 (EST)
Message-ID: <201011180254.oAI2sXK17185@momjian.us> (raw)
In-Reply-To: <25379.1290032634@sss.pgh.pa.us>
Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > Tom Lane wrote:
> >> Possibly the cleanest fix is to implement pg_ping as a libpq function.
> >> You do have to distinguish connection failures (ie connection refused)
> >> from errors that came back from the postmaster, and the easiest place to
> >> be doing that is inside libpq.
>
> > OK, so a new libpq function --- got it. Would we just pass the status
> > from the backend or can it be done without backend modifications?
>
> It would definitely be better to do it without backend mods, so that
> the functionality would work against back-branch postmasters.
>
> To my mind, the entire purpose of such a function is to classify the
> possible errors so that the caller doesn't have to. So I wouldn't
> consider that it ought to "pass back the status from the backend".
> I think what we basically want is a function that takes a conninfo
> string (or one of the variants of that) and returns an enum defined
> more or less like this:
>
> * failed to connect to postmaster
> * connected, but postmaster is not accepting sessions
> * postmaster is up and accepting sessions
>
> I'm not sure those are exactly the categories we want, but something
> close to that. In particular, I don't know if there's any value in
> subdividing the "not accepting sessions" status --- pg_ctl doesn't
> really care, but other use-cases might want to tell the difference
> between the various canAcceptConnections failure states.
>
> BTW, it is annoying that we can't definitively distinguish "postmaster
> is not running" from a connectivity problem, but I can't see a way
> around that.
Agreed. I will research this.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
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: bruce@momjian.us, tgl@sss.pgh.pa.us, magnus@hagander.net, 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: <201011180254.oAI2sXK17185@momjian.us>
References: <25379.1290032634@sss.pgh.pa.us> <201011180254.oAI2sXK17185@momjian.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