Re: Using PQexecQuery in pipeline mode produces unexpected Close messages

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: alvherre(at)alvh(dot)no-ip(dot)org
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, daniele(dot)varrazzo(at)gmail(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Using PQexecQuery in pipeline mode produces unexpected Close messages
Date: 2022-06-21 08:46:54
Message-ID: 20220621.174654.1333611196725118342.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

At Tue, 21 Jun 2022 14:56:40 +0900 (JST), Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> wrote in
> By the way, I noticed that "libpq_pipeline uniqviol" intermittently
> fails for uncertain reasons.
>
> > result 574/575: pipeline aborted
> > ...........................................................
> > done writing
> >
> > libpq_pipeline:1531: got unexpected NULL

PQsendQueryPrepared() is called after the conection's state has moved
to PGASYNC_IDLE so PQgetResult returns NULL. But actually there are
results. So, if pqPipelineProcessorQueue() doesn't move the async
state to PGASYNC_IDLE when queue is emtpy, uniqviol can run till the
end. But that change breaks almost all of other test items.

Finally, I found that the change in pqPipelineProcessorQueue() as
attached fixes the uniqviol failure and doesn't break other tests.
However, I don't understand what I did by the change for now... X(
It seems to me something's wrong in the PQ_PIPELINE_ABORTED mode..

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
v6-0001-Avoid-going-IDLE-in-pipeline-mode.patch text/x-patch 12.6 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Amit Kapila 2022-06-21 13:38:36 Re: BUG #17524: Increase in WAL size due to logical replication with publication contain a table with low activity.
Previous Message Kyotaro Horiguchi 2022-06-21 06:05:02 Re: Using PQexecQuery in pipeline mode produces unexpected Close messages

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2022-06-21 08:49:01 Re: Replica Identity check of partition table on subscriber
Previous Message Pavel Stehule 2022-06-21 08:46:06 Re: Schema variables - new implementation for Postgres 15