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_a3ce810f59132d8e230475a5f0f7a08c8...@qq.com Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e74c916657b56e062e244be97ea17c57c178ade0 Modified Files -------------- src/backend/access/gin/ginbtree.c | 68 ++++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 18 deletions(-)