Re: Suggestion to add --continue-client-on-abort option to pgbench - Mailing list pgsql-hackers

From Chao Li
Subject Re: Suggestion to add --continue-client-on-abort option to pgbench
Date
Msg-id 7BF486E2-E9D3-4F52-A643-C9FEA4CE5F92@gmail.com
Whole thread Raw
In response to Re: Suggestion to add --continue-client-on-abort option to pgbench  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: Suggestion to add --continue-client-on-abort option to pgbench
List pgsql-hackers

> On Nov 7, 2025, at 17:33, Fujii Masao <masao.fujii@gmail.com> wrote:
>
> On Fri, Nov 7, 2025 at 9:07 AM Chao Li <li.evan.chao@gmail.com> wrote:
>> If you put this explanation to the inline comment, things would get clearer. But based on this explanation, I just
gotthe other doubt. When a pipeline is aborted, res is NULL, but we still stay in the for loop, PQClear(res) will do
nothing,then the “for” loop is similar to an empty loop, would that lead to a high CPU usage? From this perspective,
whenpipeline is aborted, while waiting for PIPELINE_SYNC, adding a tiny sleep might be better. 
>
> You're concerned about cases where the server response is delayed,
> causing the pipeline status to take time to reach PIPELINE_SYNC, right?
> In that situation, since discardAvailableResults() waits on PQgetResult(),
> it shouldn't enter a busy loop, correct?
>
>
>> I will back to work next Monday, then I will try to run a test and reproduce the scenario of pipeline abort.
>
> I plan to commit the patch soon, but let's keep discussing and
> investigating the case you mentioned afterward!
>

I just did a test. In the test, I inserted a tuple with the same primary key so that the inserts fails by the unique
keyconstraint which breaks the pipeline, and some random select statements followed. And I added some debug messages in
discardAvailableResults(),which showed me that the function will discard rest of statements’ results until
\endpipeline.As there are anyway limited number of statements before \endpipeline, my concern is actually not valid.
So,now I am good with this patch. 

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/







pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Changing the state of data checksums in a running cluster
Next
From: Chao Li
Date:
Subject: Re: Add tests for object size limits of injection points