pgsql: Avoid trying to fetch metapage of an SPGist partitioned index.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Avoid trying to fetch metapage of an SPGist partitioned index.
Date: 2023-12-21 17:43:48
Message-ID: E1rGN5H-00BGTf-V5@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid trying to fetch metapage of an SPGist partitioned index.

This is necessary when spgcanreturn() is invoked on a partitioned
index, and the failure might be reachable in other scenarios as
well. The rest of what spgGetCache() does is perfectly sensible
for a partitioned index, so we should allow it to go through.

I think the main takeaway from this is that we lack sufficient test
coverage for non-btree partitioned indexes. Therefore, I added
simple test cases for brin and gin as well as spgist (hash and
gist AMs were covered already in indexing.sql).

Per bug #18256 from Alexander Lakhin. Although the known test case
only fails since v16 (3c569049b), I've got no faith at all that there
aren't other ways to reach this problem; so back-patch to all
supported branches.

Discussion: https://postgr.es/m/18256-0b0e1b6e4a620f1b@postgresql.org

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/cc3865150b8ae3d1951f78cf6bb7af1bc63b688d

Modified Files
--------------
src/backend/access/spgist/spgutils.c | 29 +++++++++++++++----------
src/test/regress/expected/indexing.out | 39 ++++++++++++++++++++++++++++++++++
src/test/regress/sql/indexing.sql | 20 +++++++++++++++++
3 files changed, 77 insertions(+), 11 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2023-12-21 20:04:13 pgsql: pg_combinebackup didn't clean its tmp_check directory, either.
Previous Message Dean Rasheed 2023-12-21 12:57:59 pgsql: Fix BEFORE ROW trigger handling in cross-partition MERGE update.