pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Ignore invalidated slots while computing oldest catalog Xmin
Date: Tue, 22 Nov 2022 09:56:57 +0000
Message-ID: <E1oxQ1Q-000L9g-Ue@gemulon.postgresql.org> (raw)

Ignore invalidated slots while computing oldest catalog Xmin

Once a logical slot has acquired a catalog_xmin, it doesn't let go of
it, even when invalidated by exceeding the max_slot_wal_keep_size, which
means that dead catalog tuples are not removed by vacuum anymore since
the point is invalidated, until the slot is dropped.  This could be
catastrophic if catalog churn is high.

Change the computation of Xmin to ignore invalidated slots,
to prevent dead rows from accumulating.

Backpatch to 13, where slot invalidation appeared.

Author: Sirisha Chamarthi <sirichamarthi22@gmail.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Discussion: https://postgr.es/m/CAKrAKeUEDeqquN9vwzNeG-CN8wuVsfRYbeOUV9qKO_RHok=j+g@mail.gmail.com

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1ad033df16df8d9f9e9f597ca31915266dfbdfb9

Modified Files
--------------
src/backend/replication/slot.c      | 7 +++++++
src/backend/storage/ipc/procarray.c | 3 +++
2 files changed, 10 insertions(+)



view thread (4+ messages)

Message-ID: <E1oxQ1Q-000L9g-Ue@gemulon.postgresql.org>
Permalink:  ../E1oxQ1Q-000L9g-Ue@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1oxQ1Q-000L9g-Ue@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: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Ignore invalidated slots while computing oldest catalog Xmin
  In-Reply-To: <E1oxQ1Q-000L9g-Ue@gemulon.postgresql.org>
  References: <E1oxQ1Q-000L9g-Ue@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