Re: Assertion failure in pgbench
Fujii Masao <masao.fujii@gmail.com>
From: Fujii Masao <masao.fujii@gmail.com>
To: Tatsuo Ishii <ishii@postgresql.org>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2025-08-01T11:55:10Z
Lists: pgsql-hackers
Attachments
- v2-0001-PG15_PG16-Fix-assertion-failure-in-pgbench-when-handling-mu.patch (application/octet-stream) patch v2-0001
- v2-0001-Fix-assertion-failure-in-pgbench-when-handling-mu.patch (application/octet-stream) patch v2-0001
On Fri, Aug 1, 2025 at 9:03 AM Tatsuo Ishii <ishii@postgresql.org> wrote: > > > On Thu, Jul 31, 2025 at 11:03 AM Tatsuo Ishii <ishii@postgresql.org> wrote: > >> > Yes. When an error occurs and an error response message returned from > >> > backend, pgbench will send one more sync message, then sends ROLLBACK > >> > if necessary. I think the code above should be changed to call > >> > PQgetResult repeatably until it returns NULL. > > > > I was thinking the same. The attached patch implements that approach, > > and it seems to eliminate the assertion failure. > > The patch looks good to me and I confirmed it fixes the the assertion > failure. Thanks for the review and testing! I've updated the commit message and attached a revised version of the patch. This assertion failure can occur when retriable errors (like serialization errors) happen while using pipeline mode. Since this issue exists from v15 onward, the fix should be back-patched to v15. I’ve also attached a version of the patch that applies cleanly to v15 and v16, as the master patch doesn’t apply cleanly to those branches. Unless there are any objections, I plan to commit this and back-patch to v15. Regards, -- Fujii Masao
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix assertion failure in pgbench when handling multiple pipeline sync messages.
- 6914a330f019 15.14 landed
- 1d3ded521a0b 16.10 landed
- 398e07162eca 17.6 landed
- fee46ab4f244 18.0 landed
- 12efa48978c6 19 (unreleased) landed