| From: | Peter Geoghegan <pg(at)bowt(dot)ie> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Add tests for nbtree empty index predicate locking. |
| Date: | 2026-07-25 18:16:18 |
| Message-ID: | E1wngv4-00000000HZ8-464U@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
Add tests for nbtree empty index predicate locking.
Add coverage for predicate locking of completely empty nbtree indexes,
where we must predicate lock the entire relation (instead of some
individual leaf page). Both paths that can find the index empty (and
must consider whether it's still empty after PredicateLockRelation
returns) are covered by a new isolation test that uses injection points.
Catalog relation scans skip the injection points. The waiting session
runs catalog queries of its own after arming the (session-local) points,
and could otherwise suspend itself with nothing lined up to wake it.
Follow-up to bugfix commits ce3f19e2 (the _bt_endpoint fix) and f9b7fc65
(the _bt_first/_bt_search fix).
Author: Peter Geoghegan <pg(at)bowt(dot)ie>
Discussion: https://postgr.es/m/CAH2-WzkNoTn3yXY0iGkSuavJ+sL8EROf+kitW+_2v2tJVWuKmA@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/62c05d6f2fa64cce44e57871b4cfcd7b34589fcf
Modified Files
--------------
src/backend/access/nbtree/nbtsearch.c | 12 +++
src/test/modules/nbtree/Makefile | 2 +
.../nbtree/expected/predicate-empty-index.out | 87 ++++++++++++++++++++++
src/test/modules/nbtree/meson.build | 5 ++
.../nbtree/specs/predicate-empty-index.spec | 73 ++++++++++++++++++
5 files changed, 179 insertions(+)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Peter Geoghegan | 2026-07-25 21:13:32 | pgsql: Add test coverage for nbtree backwards scans. |
| Previous Message | Álvaro Herrera | 2026-07-25 17:17:22 | pgsql: Add missing PGDLLIMPORT marker |