public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: Kirill Reshke <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: Release and unpin buffers after leaving CRIT section in GIN.
Date: Thu, 19 Feb 2026 16:02:23 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <CALdSSPj9ixr6Uf8kMs8FfcDcUWx7cQ-iysLiLJ0n-2henP1-sQ@mail.gmail.com>
References: <CALdSSPgBPnpNNzxv0Y+_GNFzW6PmzRZYh+_hpf06Y1N2zLhZaQ@mail.gmail.com>
	<[email protected]>
	<CALdSSPj9ixr6Uf8kMs8FfcDcUWx7cQ-iysLiLJ0n-2henP1-sQ@mail.gmail.com>

On Tue, Feb 17, 2026 at 03:14:45PM +0500, Kirill Reshke wrote:
> Looks like there are two more instances of this on HEAD: in gistbuild
> and log_newpage_range. Is it?

Planting an assertion in UnlockReleaseBuffer(), there are two extra
places that can be spotted:
- Most of the places reported by the regression tests seem to come
from gistplacetopage(), with UnlockReleaseBuffer() called for a
rootsplit.  This case is actually OK to me, where the new buffers are
all unlocked with the root page locked.  I have to admit that I am not
the best specialist ever on this one, so I may be missing something.
- ginHeapTupleFastInsert(), with UnlockReleaseBuffer() called before
GinGetPendingListCleanupSize().  This one is not in line, being
registered as buffer in a XLOG_GIN_UPDATE_META_PAGE record.  We could
do better here.

Saying that, the cases of createPostingTree()@gindatapage.c, the three
in ginfast.c, the one in ginutil.c, the two in ginvacuum.c (one with
only unpins), and xloginsert.c are no-brainers to me, so I have
applied these.

The two proposed cases in gininsert.c and gistbuild.c do nothing
related to WAL-logging, though.
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../[email protected]/2-signature.asc)
  download

view thread (2+ messages)

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: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Release and unpin buffers after leaving CRIT section in GIN.
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox