pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Masahiko Sawada <msawada@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pgstat: fix subscription stats entry leak.
Date: Wed, 05 Jul 2023 05:54:29 +0000
Message-ID: <E1qGvTC-001z2d-1O@gemulon.postgresql.org> (raw)

pgstat: fix subscription stats entry leak.

Commit 7b64e4b3 taught DropSubscription() to drop stats entry of
subscription that is not associated with a replication slot for apply
worker at DROP SUBSCRIPTION but missed covering the case where the
subscription is not associated with replication slots for both apply
worker and tablesync worker.

Also add a test to verify that the stats for slot-less subscription is
removed at DROP SUBSCRIPTION time.

Backpatch down to 15.

Author: Masahiko Sawada
Reviewed-by: Nathan Bossart, Hayato Kuroda, Melih Mutlu, Amit Kapila
Discussion: https://postgr.es/m/CAD21AoB71zkP7uPT7JDPsZcvp0749ExEQnOJxeNKPDFisHar+w@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/be8cae7e2f03f35a049e2b1f1113860fea6d0212

Modified Files
--------------
src/backend/commands/subscriptioncmds.c | 12 ++++++------
src/test/subscription/t/026_stats.pl    | 20 ++++++++++++++++++++
2 files changed, 26 insertions(+), 6 deletions(-)



view thread (3+ messages)  latest in thread

Message-ID: <E1qGvTC-001z2d-1O@gemulon.postgresql.org>
Permalink:  ../E1qGvTC-001z2d-1O@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qGvTC-001z2d-1O@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: msawada@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: pgstat: fix subscription stats entry leak.
  In-Reply-To: <E1qGvTC-001z2d-1O@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