Re: Suggestion to add --continue-client-on-abort option to pgbench

Chao Li <li.evan.chao@gmail.com>

From: Chao Li <li.evan.chao@gmail.com>
To: Fujii Masao <masao.fujii@gmail.com>
Cc: Yugo Nagata <nagata@sraoss.co.jp>, Rintaro Ikeda <ikedarintarof@oss.nttdata.com>, Jakub Wartak <jakub.wartak@enterprisedb.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, "slpmcf@gmail.com" <slpmcf@gmail.com>, "boekewurm+postgres@gmail.com" <boekewurm+postgres@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, Srinath Reddy Sadipiralla <srinath2133@gmail.com>, Dilip Kumar <dilipbalaut@gmail.com>
Date: 2025-11-13T04:02:42Z
Lists: pgsql-hackers

> On Nov 13, 2025, at 11:47, Fujii Masao <masao.fujii@gmail.com> wrote:
> 
> On Thu, Nov 13, 2025 at 11:21 AM Chao Li <li.evan.chao@gmail.com> wrote:
>> I debugged further this morning, and I think I have found the root cause. Ultimately, the problem is not with discardUntilSync(), instead, discardAvailableResults() mistakenly eats PGRES_PIPELINE_SYNC.
> 
> Thanks for debugging!
> 
> Yes, discardAvailableResults() can discard PGRES_PIPELINE_SYNC,
> but do you mean that's the root cause of the assertion failure
> Nagata-san reported?
> Since that failure can occur even in older branches, I was thinking
> that newer code
> like discardAvailableResults() in master isn't the root cause...
> 

I haven’t debugged with old code, but the old code also discard non-NULL results:

```
- do
- {
- res = PQgetResult(st->con);
- PQclear(res);
- } while (res);
+ discardAvailableResults(st);
```

Which may also discard the sync message. That’s my guess. I can also debug the old code this afternoon.

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







Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. pgbench: Fix assertion failure with multiple \syncpipeline in pipeline mode.

  2. pgbench: Add --continue-on-error option.

  3. Fix "inconsistent DLL linkage" warning on Windows MSVC

  4. pgbench: Fix error reporting in readCommandResponse().

  5. pgbench: Fix assertion failure with retriable errors in pipeline mode.

  6. Allow pgbench to retry in some cases.