pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix locking when fixing an incomplete split of a GIN internal pa
Date: Mon, 29 Jan 2024 11:52:37 +0000
Message-ID: <E1rUQBp-003gCI-Mn@gemulon.postgresql.org> (raw)

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

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(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1rUQBp-003gCI-Mn@gemulon.postgresql.org>
Permalink:  ../E1rUQBp-003gCI-Mn@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rUQBp-003gCI-Mn@gemulon.postgresql.org

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: heikki.linnakangas@iki.fi, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix locking when fixing an incomplete split of a GIN internal pa
  In-Reply-To: <E1rUQBp-003gCI-Mn@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