pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: 'alvherre@alvh.no-ip.org' <alvherre@alvh.no-ip.org>
Cc: iwata.aya@fujitsu.com <iwata.aya@fujitsu.com>
Cc: tsunakawa.takay@fujitsu.com <tsunakawa.takay@fujitsu.com>
Cc: k.jamison@fujitsu.com <k.jamison@fujitsu.com>
Cc: 'Kyotaro Horiguchi' <horikyota.ntt@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>
Subject: Re: libpq debug log
Date: Wed, 10 Mar 2021 15:03:35 -0500
Message-ID: <2189612.1615406615@sss.pgh.pa.us> (raw)
In-Reply-To: <20210310194314.GA22403@alvherre.pgsql>
References: <20210310194314.GA22403@alvherre.pgsql>

"'alvherre@alvh.no-ip.org'" <alvherre@alvh.no-ip.org> writes:
> After staring at it a couple of times, I think that the places in
> pqParseInput3() where there's a comment "... moves inStart itself" and
> then "continue;" should have a call to pqTraceOutputMsg(), since AFAIU
> those are the places where the message in question would not reach the
> "Successfully consumed this message" block that prints each message.

Yeah, the whole business of just when a message has been "consumed"
is a stumbling block for libpq tracing.  It was a real mess with the
existing code and v2 protocol, because we could actually try to parse
a message more than once, with the first few tries deciding that the
message wasn't all here yet (but nonetheless emitting partial trace
output).

Now that v2 is dead, the logic to abort because of the message not
being all arrived yet is basically useless: only the little bit of
code concerned with the message length word really needs to cope with
that.  It's tempting to go through and get rid of all the now-unreachable
"return"s and such, but it seemed like it would be a lot of code churn for
not really that much gain.

I didn't look at the new version of the patch yet, so I'm not
sure whether the issues it still has are related to this.

			regards, tom lane





view thread (234+ messages)  latest in thread

Message-ID: <2189612.1615406615@sss.pgh.pa.us>
Permalink:  ../2189612.1615406615@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2189612.1615406615@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, alvherre@alvh.no-ip.org, iwata.aya@fujitsu.com, tsunakawa.takay@fujitsu.com, k.jamison@fujitsu.com, horikyota.ntt@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: libpq debug log
  In-Reply-To: <2189612.1615406615@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