git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 6d4565a) | patch
Fix locking when fixing an incomplete split of a GIN internal page
2024年1月29日 11:46:22 +0000 (13:46 +0200)
2024年1月29日 11:46:22 +0000 (13:46 +0200)
commit 6a1ea02c491d16474a6214603dce40b5b122d4d1
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
src/backend/access/gin/ginbtree.c diff | blob | blame | history
src/test/modules/Makefile diff | blob | blame | history
src/test/modules/gin/Makefile [new file with mode: 0644] blob
src/test/modules/gin/expected/gin_incomplete_splits.out [new file with mode: 0644] blob
src/test/modules/gin/meson.build [new file with mode: 0644] blob
src/test/modules/gin/sql/gin_incomplete_splits.sql [new file with mode: 0644] blob
src/test/modules/meson.build diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /