Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1joTjv-0007xx-Dc for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Jun 2020 15:24:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1joTju-00070L-BP for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Jun 2020 15:24:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1joTju-00070E-09 for pgsql-hackers@lists.postgresql.org; Thu, 25 Jun 2020 15:24:34 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1joTjr-0006r0-PX for pgsql-hackers@postgresql.org; Thu, 25 Jun 2020 15:24:33 +0000 Received: by mail-qk1-x743.google.com with SMTP id k18so5638629qke.4 for ; Thu, 25 Jun 2020 08:24:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=tV3Kbm6FbenPl4dMNq5o9x1vCaqqlXMezz9+CnsenFI=; b=i3OnQS7uQaLvswcp2HB/tDbevdfe9alKZjBmGxnyWwgNuQFNq9mDXjs6z6hc7U6kSP JLyOHk6LULMxhw+TiDS0rJKQgXzS5H9ZA485tq+rPD2q3f9x+6fM2ttnbbSbMP6IK6E5 J6T/MpvVE7fjHtgglm280riTfFTC0KuwBO1cdzBLGuL1d6CFa0a7H7HU6URhW6udpnZ/ sHLu0n5oJBJoHUpqHENZaSHBTr0SiAzpFlQQPb2GVWpjD9wIEEpp9P1EDWTbl1DZBAr6 WCJNw1ivVd9HuQmVSCsgVNvF/659QRUQuE8s5ycaYecgOOVG9t08EGwFD08ImeKovCrG JD4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=tV3Kbm6FbenPl4dMNq5o9x1vCaqqlXMezz9+CnsenFI=; b=CkHnrXtQbLpSNb+er9Al8PnAV9R95a5F8TKvGVrO7tabGNUpoa29SjLs4ORoshJqKQ 1PFmnxpH+yuhQLTzKSUixX1AFO7fk6sBsUZCT/YrbY9eaJXPvyQZ02/YLBYwNFhvoABo HipwLzJj0PcWQ8r2cP8wNFe5PU1z+8njA5Elj/W8U4TOVwBlRqsUYhCNngA7AriKKpyJ 7hCZ2KBH7e0N0Enbb/pynnO2OhJi7kA99xQg/smpiSAhQae6RPFcqqBmYTZsgBS+UqBy zaIQnqBlk1oPuSvwSSSh3gQc+xOMrPDT7As3jRHL4hC0kQljglQJEXpyYHlztWnnh+re iVkA== X-Gm-Message-State: AOAM532ETkbqL+MJAKZ5m9SUSKEsnAeC23y1SIdRlEg1bslwu/wYFiZJ 4qcJM7+PDpBMM8Z6U17j6jrupg== X-Google-Smtp-Source: ABdhPJzzzjGh2DMxibLyvhEQnMm4U9A9lOHBq6qKhSKFSvu9qgLHQrhsWZfjJDjITq2yiLZwc6OklQ== X-Received: by 2002:a37:4fca:: with SMTP id d193mr8472352qkb.364.1593098670471; Thu, 25 Jun 2020 08:24:30 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([190.95.18.252]) by smtp.gmail.com with ESMTPSA id z77sm6133429qka.59.2020.06.25.08.24.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2020 08:24:29 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 8E86A2A39E0; Thu, 25 Jun 2020 11:24:27 -0400 (-04) Date: Thu, 25 Jun 2020 11:24:27 -0400 From: Alvaro Herrera To: Amit Kapila Cc: Fujii Masao , Kyotaro Horiguchi , Michael Paquier , pgsql-hackers Subject: Re: min_safe_lsn column in pg_replication_slots view Message-ID: <20200625152427.GA17823@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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