pg.ddx.io pgsql-hackers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Kuntal Ghosh <kuntalghosh.2007@gmail.com>
Subject: Re: auxiliary processes in pg_stat_ssl
Date: Mon, 4 Nov 2019 11:06:05 -0500
Message-ID: <20191104160605.GC6962@tamriel.snowman.net> (raw)
In-Reply-To: <CA+Tgmobz8yTDbXMmefKAAUkJ+WpFWQPMy9+GFipbn-NAZuqjtQ@mail.gmail.com>
References: <20190904151535.GA29108@alvherre.pgsql>
<20191104132559.GA18441@alvherre.pgsql>
<CA+Tgmobz8yTDbXMmefKAAUkJ+WpFWQPMy9+GFipbn-NAZuqjtQ@mail.gmail.com>
Greetings,
* Robert Haas (robertmhaas@gmail.com) wrote:
> On Mon, Nov 4, 2019 at 8:26 AM Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> > On 2019-Sep-04, Alvaro Herrera wrote:
> > > I just noticed that we list auxiliary processes in pg_stat_ssl:
> > [...]
> > > But this seems pointless. Should we not hide those? Seems this only
> > > happened as an unintended side-effect of fc70a4b0df38. It appears to me
> > > that we should redefine that view to restrict backend_type that's
> > > 'client backend' (maybe include 'wal receiver'/'wal sender' also, not
> > > sure.)
> >
> > [crickets]
> >
> > Robert, Kuntal, any opinion on this?
>
> I think if I were doing something about it, I'd probably try to filter
> on a field that directly represents whether there is a connection,
> rather than checking the backend type. That way, if the list of
> backend types that have client connections changes later, there's
> nothing to update. Like "WHERE client_port IS NOT NULL," or something
> of that sort.
Yeah, using a "this has a connection" would be better and, as also noted
on this thread, pg_stat_gssapi should get similar treatment.
Based on what we claim in our docs, it does look like 'client_port IS
NOT NULL' should work. I do think we might want to update the docs to
make it a bit more explicit, what we say now is:
TCP port number that the client is using for communication with this
backend, or -1 if a Unix socket is used
We don't explain there that NULL means the backend doesn't have an
external connection even though plenty of those entries show up in every
instance of PG. Perhaps we should add this:
If this field is null, it indicates that this is an internal process
such as autovacuum.
Which is what we say for 'client_addr'.
I have to admit that while it's handy that we just shove '-1' into
client_port when it's a unix socket, it's kind of ugly from a data
perspective- in a green field it'd probably be better to have a
"connection type" field that then indicates which other fields are valid
instead of having a special constant, but that ship sailed long ago and
it's not like we have a lot of people complaining about it, so I suppose
just using it here as suggested is fine.
Thanks,
Stephen
Attachments:
signature.asc (application/pgp-signature, 818B) download
view thread (8+ messages) latest in thread
Message-ID: <20191104160605.GC6962@tamriel.snowman.net> Permalink: ../20191104160605.GC6962@tamriel.snowman.net/ Also on: postgresql.org/message-id/20191104160605.GC6962@tamriel.snowman.net ·
reply
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 using the --to and --cc options: reply via email To: pgsql-hackers@postgresql.org Cc: sfrost@snowman.net, robertmhaas@gmail.com, alvherre@2ndquadrant.com, pgsql-hackers@lists.postgresql.org, kuntalghosh.2007@gmail.com Subject: Re: auxiliary processes in pg_stat_ssl In-Reply-To: <20191104160605.GC6962@tamriel.snowman.net> * 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