]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay.
authorAmit Kapila <akapila@postgresql.org>
Mon, 14 Nov 2022 04:52:28 +0000 (10:22 +0530)
committerAmit Kapila <akapila@postgresql.org>
Mon, 14 Nov 2022 04:52:28 +0000 (10:22 +0530)
commit9693f190076ec04fd06d63ab00ba4d0383515b7c
tree4fb246fe794442f0869428bed218c7eb161d3aa1
parentf893af496100737b7fa1ef861ac8bd2705b4d5f1
Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay.

During XLOG_HASH_SPLIT_ALLOCATE_PAGE replay, we were checking for a
cleanup lock on the new bucket page after acquiring an exclusive lock on
it and raising a PANIC error on failure. However, it is quite possible
that checkpointer can acquire the pin on the same page before acquiring a
lock on it, and then the replay will lead to an error. So instead, directly
acquire the cleanup lock on the new bucket page during
XLOG_HASH_SPLIT_ALLOCATE_PAGE replay operation.

Reported-by: Andres Freund
Author: Robert Haas
Reviewed-By: Amit Kapila, Andres Freund, Vignesh C
Backpatch-through: 11
Discussion: https://postgr.es/m/20220810022617.fvjkjiauaykwrbse@awork3.anarazel.de
src/backend/access/hash/hash_xlog.c
src/backend/access/hash/hashpage.c