TRAP: failed Assert("offsets[i] > offsets[i - 1]"), File: "tidstore.c"
Andrei Lepikhov <lepihov@gmail.com>
From: Andrei Lepikhov <lepihov@gmail.com>
To: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>,
Masahiko Sawada <sawada.mshk@gmail.com>
Date: 2026-04-15T12:48:35Z
Lists: pgsql-bugs
Attachments
- v0-0001-Sort-offsets-in-test_tidstore-s-do_set_block_offs.patch (text/plain) patch v0-0001
Hi, While experimenting with query plans, I periodically see test_tidstore fail on the assertion in TidStoreSetBlockOffsets(). The cause is that the harness function do_set_block_offsets() forwards the SQL array straight to TidStoreSetBlockOffsets(), which has an explicit contract: "The offset numbers 'offsets' must be sorted in ascending order." array_agg() without ORDER BY gives no such guarantee, and plan shapes that reshuffle the input can deliver the offsets out of order and trip the Assert. The issue is minor and doesn't expose any underlying bug, but it is still worth fixing: it removes a source of flaky test runs and makes life easier for extension developers who reuse the same pattern. Patch attached. -- regards, Andrei Lepikhov, pgEdge
Commits
-
test_tidstore: Stabilize regression tests by sorting offsets.
- 0b3f72f8816b 17.10 landed
- cfbfdb963a42 18.4 landed
- a424e31b16ba 19 (unreleased) landed