From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: min_safe_lsn column in pg_replication_slots view
Date: Thu, 25 Jun 2020 11:24:27 -0400
Message-ID: <20200625152427.GA17823@alvherre.pgsql> (raw)
In-Reply-To: <CAA4eK1Kje05UBsvb7Frz2OtYWnwSedHxmooKcAo+h31HbjOXHg@mail.gmail.com>
On 2020-Jun-25, Amit Kapila wrote:
> +1. I also think let's drop the idea of exposing a function for this
> value and revert the min_safe_lsn part of the work as proposed by
> Michael above [1] excluding the function pg_wal_oldest_lsn() in that
> patch. Then, we can expose this as a new stat for PG14. I feel it
> would be better to display this stat in a new view (something like
> pg_stat_replication_slots) as discussed in another thread [2]. Does
> that make sense?
I don't understand the proposal. Michael posted a patch that adds
pg_wal_oldest_lsn(), and you say we should apply the patch except the
part that adds that function -- so what part would be applying?
If the proposal is to apply just the hunk in pg_get_replication_slots
that removes min_safe_lsn, and do nothing else in pg13, then I don't like
it. The feature exposes a way to monitor slots w.r.t. the maximum slot
size; I'm okay if you prefer to express that in a different way, but I
don't like the idea of shipping pg13 without any way to monitor it.
As reported by Masao-san, the current min_safe_lsn has a definitional
problem when used with pg_walfile_name(), but we've established that
that's because pg_walfile_name() has a special-case definition, not
because min_safe_lsn itself is bogus. If we're looking for a minimal
change that can fix this problem, let's increment one byte, which should
fix that issue, no?
I also see that some people complain that all slots return the same
value and therefore this column is redundant. To that argument I say
that it's not unreasonable that we'll add a slot-specific size limit;
and if we do, we'll be happy we had slot-specific min safe LSN; see e.g.
https://postgr.es/m/20170301160610.wc7ez3vihmialntd@alap3.anarazel.de
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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-hackers@postgresql.org
Cc: alvherre@2ndquadrant.com, amit.kapila16@gmail.com, masao.fujii@oss.nttdata.com, horikyota.ntt@gmail.com, michael@paquier.xyz
Subject: Re: min_safe_lsn column in pg_replication_slots view
In-Reply-To: <20200625152427.GA17823@alvherre.pgsql>
* 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