From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Don't release index root page pin in ginFindParents(). |
Date: | 2023-11-13 16:45:42 |
Message-ID: | E1r2a4E-005GCp-1K@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Don't release index root page pin in ginFindParents().
It's clearly stated in the comments that ginFindParents() must keep
the pin on the index's root page that's associated with the topmost
GinBtreeStack item. However, the code path for the case that the
desired downlink has been pushed down to the next index level
ignored this proviso, and would release the pin anyway if we were
still examining the root level. That led to an assertion failure
or "buffer NNNN is not owned by resource owner" error later, when
we try to release the pin again at the end of the insertion.
This is quite hard to reproduce, since it can only happen if an
index root page split occurs concurrently with our own insertion.
Thanks to Jeff Janes for finding a test case that triggers it
often enough to allow investigation.
This has been there since the beginning of GIN, so back-patch
to all supported branches.
Discussion: https://postgr.es/m/CAMkU=1yCAKtv86dMrD__Ja-7KzjE=uMeKX8y__cx5W-OEWy2ow@mail.gmail.com
Branch
------
REL_12_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/5a6937ec9d41c5d61b72ce42a927a0d590e79491
Modified Files
--------------
src/backend/access/gin/ginbtree.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2023-11-13 17:41:07 | pgsql: doc: remove RUNAS instructions for pg_upgrade on Windows |
Previous Message | Daniel Gustafsson | 2023-11-13 13:24:35 | pgsql: doc: Add missing semicolon in example |