pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Acquire spinlock when updating 2PC slot data during logical deco
Date: Thu, 12 Jan 2023 04:41:39 +0000
Message-ID: <E1pFpPH-003EMy-L7@gemulon.postgresql.org> (raw)

Acquire spinlock when updating 2PC slot data during logical decoding creation

The creation of a logical decoding context in CreateDecodingContext()
updates some data of its slot for two-phase transactions if enabled by
the caller, but the code forgot to acquire a spinlock when updating
these fields like any other code paths.  This could lead to the read of
inconsistent data.

Oversight in a8fd13c.

Author: Sawada Masahiko
Discussion: https://postgr.es/m/CAD21AoAD8_fp47191LKuecjDd3DYhoQ4TaucFco1_TEr_jQ-Zw@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6f25e48774fe9302ca08dae07420df95998d792a

Modified Files
--------------
src/backend/replication/logical/logical.c | 2 ++
1 file changed, 2 insertions(+)



view thread (2+ messages)

Message-ID: <E1pFpPH-003EMy-L7@gemulon.postgresql.org>
Permalink:  ../E1pFpPH-003EMy-L7@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pFpPH-003EMy-L7@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 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: michael@paquier.xyz
  Subject: Re: pgsql: Acquire spinlock when updating 2PC slot data during logical deco
  In-Reply-To: <E1pFpPH-003EMy-L7@gemulon.postgresql.org>
  References: <E1pFpPH-003EMy-L7@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