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: Allow synced slots to have their inactive_since.
Date: Fri, 05 Apr 2024 04:34:02 +0000
Message-ID: <E1rsbH7-000a9I-Om@gemulon.postgresql.org> (raw)

Allow synced slots to have their inactive_since.

This commit does two things:
1) Maintains inactive_since for sync slots whenever the slot is released
just like any other regular slot.

2) Ensures the value is set to the current timestamp during the promotion
of standby to help correctly interpret the time after promotion. We don't
want the slots to appear inactive for a long time after promotion if they
haven't been synchronized recently. This would also avoid the invalidation
of such slots immediately after promotion if tomorrow we have a feature
that invalidates slots based on their inactivity time. Whoever acquires
the slot i.e. makes the slot active will reset it to NULL.

Author: Bharath Rupireddy
Reviewed-by: Bertrand Drouvot, Amit Kapila, Shveta Malik, Masahiko Sawada
Discussion: https://postgr.es/m/CAA4eK1KrPGwfZV9LYGidjxHeW+rxJ=E2ThjXvwRGLO=iLNuo=Q@mail.gmail.com
Discussion: https://postgr.es/m/CALj2ACW4aUe-_uFQOjdWCEN-xXoLGhmvRFnL8SNw_TZ5nJe+aw@mail.gmail.com
Discussion: https://postgr.es/m/CA+Tgmob_Ta-t2ty8QrKHBGnNLrf4ZYcwhGHGFsuUoFrAEDw4sA@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
doc/src/sgml/system-views.sgml                     |  7 +++
src/backend/replication/logical/slotsync.c         | 57 ++++++++++++++++++++++
src/backend/replication/slot.c                     | 22 +++------
src/test/perl/PostgreSQL/Test/Cluster.pm           | 31 ++++++++++++
src/test/recovery/t/019_replslot_limit.pl          | 26 +---------
.../recovery/t/040_standby_failover_slots_sync.pl  | 56 +++++++++++++++++++++
6 files changed, 160 insertions(+), 39 deletions(-)



Message-ID: <E1rsbH7-000a9I-Om@gemulon.postgresql.org>
Permalink:  ../E1rsbH7-000a9I-Om@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rsbH7-000a9I-Om@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: akapila@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Allow synced slots to have their inactive_since.
  In-Reply-To: <E1rsbH7-000a9I-Om@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