From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Yugo NAGATA <nagata@sraoss.co.jp>
Cc: pgsql-hackers@postgresql.org
Subject: Re: pgbench: using prepared BEGIN statement in a pipeline could cause an error
Date: Sat, 17 Jul 2021 07:03:01 +0200 (CEST)
Message-ID: <alpine.DEB.2.22.394.2107170650260.3143659@pseudo> (raw)
In-Reply-To: <20210716153013.fc53b1c780b06fccc07a7f0d@sraoss.co.jp>
References: <20210716153013.fc53b1c780b06fccc07a7f0d@sraoss.co.jp>
Hello Yugo-san,
> [...] One way to avoid these errors is to send Parse messages before
> pipeline mode starts. I attached a patch to fix to prepare commands at
> starting of a script instead of at the first execution of the command.
> What do you think?
ISTM that moving prepare out of command execution is a good idea, so I'm
in favor of this approach: the code is simpler and cleaner.
ISTM that a minor impact is that the preparation is not counted in the
command performance statistics. I do not think that it is a problem, even
if it would change detailed results under -C -r -M prepared.
Patch applies & compiles cleanly, global & local make check ok. However
the issue is not tested. I think that the patch should add a tap test case
for the problem being addressed.
I'd suggest to move the statement preparation call in the
CSTATE_CHOOSE_SCRIPT case.
In comments: not yet -> needed.
--
Fabien.
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: coelho@cri.ensmp.fr, nagata@sraoss.co.jp
Subject: Re: pgbench: using prepared BEGIN statement in a pipeline could cause an error
In-Reply-To: <alpine.DEB.2.22.394.2107170650260.3143659@pseudo>
* 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