From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay.
Date: Mon, 14 Nov 2022 05:23:57 +0000
Message-ID: <E1ouRwq-00072R-SY@gemulon.postgresql.org> (raw)
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
Branch
------
REL_13_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/20c22333630111718bc97ce9a19b392f23e3c525
Modified Files
--------------
src/backend/access/hash/hash_xlog.c | 5 ++---
src/backend/access/hash/hashpage.c | 10 +++++++---
2 files changed, 9 insertions(+), 6 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: akapila@postgresql.org
Subject: Re: pgsql: Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay.
In-Reply-To: <E1ouRwq-00072R-SY@gemulon.postgresql.org>
References: <E1ouRwq-00072R-SY@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox