public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: [email protected]
Subject: pgsql: Sanitize some WAL-logging buffer handling in GIN and GiST code
Date: Thu, 19 Feb 2026 07:00:50 +0000
Message-ID: <[email protected]> (raw)

Sanitize some WAL-logging buffer handling in GIN and GiST code

As transam's README documents, the general order of actions recommended
when WAL-logging a buffer is to unlock and unpin buffers after leaving a
critical section.  This pattern was not being followed by some code
paths of GIN and GiST, adjusted in this commit, where buffers were
either unlocked or unpinned inside a critical section.  Based on my
analysis of each code path updated here, there is no reason to not
follow the recommended unlocking/unpin pattern done outside of a
critical section.

These inconsistencies are rather old, coming mainly from ecaa4708e5dd
and ff301d6e690b.  The guidelines in the README predate these commits,
being introduced in 6d61cdec0761.

Author: Kirill Reshke <[email protected]>
Discussion: https://postgr.es/m/CALdSSPgBPnpNNzxv0Y+_GNFzW6PmzRZYh+_hpf06Y1N2zLhZaQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/21e323e941cf6ff02f931cd21bcfe4ab2cb5d622

Modified Files
--------------
src/backend/access/gin/gindatapage.c    |  4 ++--
src/backend/access/gin/ginfast.c        | 12 ++++++------
src/backend/access/gin/ginutil.c        |  4 ++--
src/backend/access/gin/ginvacuum.c      |  6 +++---
src/backend/access/transam/xloginsert.c |  7 ++++---
5 files changed, 17 insertions(+), 16 deletions(-)



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: pgsql: Sanitize some WAL-logging buffer handling in GIN and GiST code
  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