From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: tgl@sss.pgh.pa.us
Cc: daniele.varrazzo@gmail.com
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Using PQexecQuery in pipeline mode produces unexpected Close messages
Date: Mon, 4 Jul 2022 10:49:33 +0200
Message-ID: <20220704084933.zi5ejy54ffdm2xlw@alvherre.pgsql> (raw)
In-Reply-To: <20220704.172744.1737300183436118987.horikyota.ntt@gmail.com>
On 2022-Jul-04, Kyotaro Horiguchi wrote:
> At Wed, 29 Jun 2022 14:09:17 +0200, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote in
> > However, another problem case, not fixed by PIPELINE_IDLE, occurs if you
> > exit pipeline mode after PQsendQuery() and then immediately use
> > PQexec(). The CloseComplete will be received at the wrong time, and a
> > notice is emitted nevertheless.
>
> Mmm. My patch moves the point of failure of the scenario a bit but
> still a little short. However, as my understanding, it seems like the
> task of the PQpipelineSync()-PQgetResult() pair to consume the
> CloseComplete. If Iinserted PQpipelineSync() just after PQsendQuery()
> and called PQgetResult() for PGRES_PIPELINE_SYNC before
> PQexitPipelineMode(), the out-of-sync CloseComplete is not seen in the
> scenario. But if it is right, I'd like to complain about the
> obscure-but-stiff protocol of pipleline mode..
Yeah, if you introduce PQpipelineSync then I think it'll work okay, but
my point here was to make it work without requiring that; that's why I
wrote the test to use PQsendFlushRequest instead.
BTW I patch for the problem with uniqviol also (not fixed by v7). I'll
send an updated patch in a little while.
> > I produced pipeline_idle.trace file by running the test in the fully
>
> By the perl script doesn't produce the trace file since the list in
> $cmptrace line doesn't contain pipleline_idle..
Ouch, of course, thanks for noticing.
--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
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-bugs@postgresql.org
Cc: alvherre@alvh.no-ip.org, horikyota.ntt@gmail.com, tgl@sss.pgh.pa.us, daniele.varrazzo@gmail.com, pgsql-hackers@lists.postgresql.org
Subject: Re: Using PQexecQuery in pipeline mode produces unexpected Close messages
In-Reply-To: <20220704084933.zi5ejy54ffdm2xlw@alvherre.pgsql>
* 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