pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix race condition in drop subscription's handling of tablesync
Date: Wed, 17 Mar 2021 02:47:20 +0000
Message-ID: <E1lMMDQ-0000pU-IV@gemulon.postgresql.org> (raw)

Fix race condition in drop subscription's handling of tablesync slots.

Commit ce0fdbfe97 made tablesync slots permanent and allow Drop
Subscription to drop such slots. However, it is possible that before
tablesync worker could get the acknowledgment of slot creation, drop
subscription stops it and that can lead to a dangling slot on the
publisher. Prevent cancel/die interrupts while creating a slot in the
tablesync worker.

Reported-by: Thomas Munro as per buildfarm
Author: Amit Kapila
Reviewed-by: Vignesh C, Takamichi Osumi
Discussion: https://postgr.es/m/CA+hUKGJG9dWpw1cOQ2nzWU8PHjm=PTraB+KgE5648K9nTfwvxg@mail.gmail.com

Branch
------
master

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

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



Message-ID: <E1lMMDQ-0000pU-IV@gemulon.postgresql.org>
Permalink:  ../E1lMMDQ-0000pU-IV@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lMMDQ-0000pU-IV@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: akapila@postgresql.org
  Subject: Re: pgsql: Fix race condition in drop subscription's handling of tablesync
  In-Reply-To: <E1lMMDQ-0000pU-IV@gemulon.postgresql.org>
  References: <E1lMMDQ-0000pU-IV@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