agora inbox for pgsql-committers@postgresql.orghelp / color / mirror / Atom feed
pgsql: test_tidstore: Stabilize regression tests by sorting offsets. 3+ messages / 1 participants [nested] [flat]
* pgsql: test_tidstore: Stabilize regression tests by sorting offsets. @ 2026-04-29 16:10 Masahiko Sawada <msawada@postgresql.org> 0 siblings, 0 replies; 3+ messages in thread From: Masahiko Sawada @ 2026-04-29 16:10 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org test_tidstore: Stabilize regression tests by sorting offsets. TidStoreSetBlockOffsets() requires its offsets array to be strictly ascending and asserts this precondition. In test_tidstore, we were passing random offset numbers deduplicated by a DISTINCT clause in an array_agg() call directly to the do_set_block_offsets() test harness. However, DISTINCT without an ORDER BY clause does not guarantee sorted results according to the SQL standard. Fix this by sorting the offsets in-place inside do_set_block_offsets() before calling TidStoreSetBlockOffsets(). While this assertion failure is not observed during regular regression tests because they use queries simple enough that the optimizer consistently chooses plans yielding sorted results, it makes sense to stabilize the test. The failure could theoretically occur depending on the optimizer's plan choice, and has been reported when experimenting with certain third-party extensions. Backpatch to v17, where test_tidstore was introduced, to ensure extension development on stable branches does not hit this assertion. Reported-by: Andrei Lepikhov <lepihov@gmail.com> Author: Andrei Lepikhov <lepihov@gmail.com> Discussion: https://postgr.es/m/b97f1850-fc7b-43c4-9b04-4e97bb9e7dc0@gmail.com Backpatch-through: 17 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/a424e31b16ba9f52f4a8a0569daf47e287198404 Modified Files -------------- src/test/modules/test_tidstore/test_tidstore.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: test_tidstore: Stabilize regression tests by sorting offsets. @ 2026-04-29 16:10 Masahiko Sawada <msawada@postgresql.org> 0 siblings, 0 replies; 3+ messages in thread From: Masahiko Sawada @ 2026-04-29 16:10 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org test_tidstore: Stabilize regression tests by sorting offsets. TidStoreSetBlockOffsets() requires its offsets array to be strictly ascending and asserts this precondition. In test_tidstore, we were passing random offset numbers deduplicated by a DISTINCT clause in an array_agg() call directly to the do_set_block_offsets() test harness. However, DISTINCT without an ORDER BY clause does not guarantee sorted results according to the SQL standard. Fix this by sorting the offsets in-place inside do_set_block_offsets() before calling TidStoreSetBlockOffsets(). While this assertion failure is not observed during regular regression tests because they use queries simple enough that the optimizer consistently chooses plans yielding sorted results, it makes sense to stabilize the test. The failure could theoretically occur depending on the optimizer's plan choice, and has been reported when experimenting with certain third-party extensions. Backpatch to v17, where test_tidstore was introduced, to ensure extension development on stable branches does not hit this assertion. Reported-by: Andrei Lepikhov <lepihov@gmail.com> Author: Andrei Lepikhov <lepihov@gmail.com> Discussion: https://postgr.es/m/b97f1850-fc7b-43c4-9b04-4e97bb9e7dc0@gmail.com Backpatch-through: 17 Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/cfbfdb963a426c4f2f47584b83e0cc4f2f463b8b Modified Files -------------- src/test/modules/test_tidstore/test_tidstore.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: test_tidstore: Stabilize regression tests by sorting offsets. @ 2026-04-29 16:10 Masahiko Sawada <msawada@postgresql.org> 0 siblings, 0 replies; 3+ messages in thread From: Masahiko Sawada @ 2026-04-29 16:10 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org test_tidstore: Stabilize regression tests by sorting offsets. TidStoreSetBlockOffsets() requires its offsets array to be strictly ascending and asserts this precondition. In test_tidstore, we were passing random offset numbers deduplicated by a DISTINCT clause in an array_agg() call directly to the do_set_block_offsets() test harness. However, DISTINCT without an ORDER BY clause does not guarantee sorted results according to the SQL standard. Fix this by sorting the offsets in-place inside do_set_block_offsets() before calling TidStoreSetBlockOffsets(). While this assertion failure is not observed during regular regression tests because they use queries simple enough that the optimizer consistently chooses plans yielding sorted results, it makes sense to stabilize the test. The failure could theoretically occur depending on the optimizer's plan choice, and has been reported when experimenting with certain third-party extensions. Backpatch to v17, where test_tidstore was introduced, to ensure extension development on stable branches does not hit this assertion. Reported-by: Andrei Lepikhov <lepihov@gmail.com> Author: Andrei Lepikhov <lepihov@gmail.com> Discussion: https://postgr.es/m/b97f1850-fc7b-43c4-9b04-4e97bb9e7dc0@gmail.com Backpatch-through: 17 Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/0b3f72f8816b06bfa8e4806f959c85040a765031 Modified Files -------------- src/test/modules/test_tidstore/test_tidstore.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2026-04-29 16:10 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-04-29 16:10 pgsql: test_tidstore: Stabilize regression tests by sorting offsets. Masahiko Sawada <msawada@postgresql.org> 2026-04-29 16:10 pgsql: test_tidstore: Stabilize regression tests by sorting offsets. Masahiko Sawada <msawada@postgresql.org> 2026-04-29 16:10 pgsql: test_tidstore: Stabilize regression tests by sorting offsets. Masahiko Sawada <msawada@postgresql.org>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox