postgresql/src/backend/access
Heikki Linnakangas f120c08724 Fix locking when fixing an incomplete split of a GIN internal page
ginFinishSplit() expects the caller to hold an exclusive lock on the
buffer, but when finishing an earlier "leftover" incomplete split of
an internal page, the caller held a shared lock. That caused an
assertion failure in MarkBufferDirty(). Without assertions, it could
lead to corruption if two backends tried to complete the split at the
same time.

On master, add a test case using the new injection point facility.

Report and analysis by Fei Changhong. Backpatch the fix to all
supported versions.

Reviewed-by: Fei Changhong, Michael Paquier
Discussion: https://www.postgresql.org/message-id/tencent_A3CE810F59132D8E230475A5F0F7A08C8307@qq.com
2024-01-29 13:46:43 +02:00
..
brin Enlarge assertion in bloom_init() for false_positive_rate 2023-11-08 14:06:42 +09:00
common doc: 1-byte varlena headers can be used for user PLAIN storage 2023-10-31 09:10:35 -04:00
gin Fix locking when fixing an incomplete split of a GIN internal page 2024-01-29 13:46:43 +02:00
gist Fix another bug in parent page splitting during GiST index build. 2023-09-26 14:15:28 +03:00
hash Fix memory leak for hashing with nondeterministic collations. 2022-12-01 11:53:53 -08:00
heap Fix assertions with RI triggers in heap_update and heap_delete. 2023-11-28 11:59:51 +02:00
index Add try_index_open(), conditional variant of index_open() 2024-01-18 15:04:39 +09:00
nbtree Fix btmarkpos/btrestrpos array key wraparound bug. 2023-09-28 16:29:29 -07:00
rmgrdesc Fix assert in logicalmsg_desc 2022-08-17 00:17:37 +02:00
spgist Avoid trying to fetch metapage of an SPGist partitioned index. 2023-12-21 12:43:36 -05:00
table Replace RelationOpenSmgr() with RelationGetSmgr(). 2022-11-17 16:54:30 -05:00
tablesample Update copyright for 2021 2021-01-02 13:06:25 -05:00
transam lwlock: Fix quadratic behavior with very long wait lists 2024-01-18 11:12:38 +09:00
Makefile Introduce access/{table.h, relation.h}, for generic functions from heapam.h. 2019-01-21 10:51:36 -08:00