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 1jo77S-0008MT-8e for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Jun 2020 15:15:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jo77R-0001Zi-0O for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Jun 2020 15:15:21 +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 1jo77Q-0001ZS-Pp for pgsql-hackers@lists.postgresql.org; Wed, 24 Jun 2020 15:15:20 +0000 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jo77O-0000Go-Ff for pgsql-hackers@postgresql.org; Wed, 24 Jun 2020 15:15:19 +0000 Received: by mail-qk1-x741.google.com with SMTP id l188so2116600qkf.10 for ; Wed, 24 Jun 2020 08:15:18 -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=nsIKrkrrOPzBP2bukKsHVtLeyrcEeolbHabWp6g1wsg=; b=acMswmrOXIIj1wJrcE4ruZ1sywMLrqZjuoq7tk6L0zjWLmfg5utt4866F5oZpFyduU 7/yRAxW8Pu/aUXCCTphFXVicwOdfY524pZWhHCbehu69GXgyTQ9Wfl/3w7+yHa+VpMi5 m1V+99lxZIJlLGJXP/iplsWn6AlSz/QgvMkkprHNMNAZpHPr9yuH/wZkgrguAp/4yN31 znGKVIvcZY2+KpR16C09uE6uKBuQCZ7RCHw0lpiaq428pimg0y2RI7SXOzdx4YlQeL8Z zehDfV/ranwdCc8jeyOTLa/fVx0Yyyq+yreEa/VqY1F+to0uT/BEBKFmJ7qTivRh7FSt v2EQ== 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=nsIKrkrrOPzBP2bukKsHVtLeyrcEeolbHabWp6g1wsg=; b=rj+LsqdA+uoDlHfFyhV5bPkrK9BuIQH2ByE8E56m6VhK/yTmnVX+OIiSINSIdoOsI3 2TJPWCl9gWaHKhyO2S9vNvFemnJOe/DwMioJky3fTg1JKa5QD7n5gFMdR1Zx+Y8vMSo+ 1LidjsaSlzR+ygG2NsifUa08QAUCu1Sty4gfDaehQd3LXzxfESqSOkQDr6SHreKswo9N kj+fbc+SnuLy4z2wTmc/VwMJonPZYgURYWF+cJNtv+a44t+f3CbwrC5CM5OYe92ukaLh 9x+BLrVUNgnXDfImjPjdeRVovNFZNuvaORSQ9yUjcmnhv4XW+vBT7C+QA9vw0orgA2V5 Dq2g== X-Gm-Message-State: AOAM532xb/8pWF4yhgqb9VqHqdXWawxUepH7XeV0Y5/TATe0waKCPxhK cTwOZU/TFTXHmIeeHC/bgthyGijZnuU= X-Google-Smtp-Source: ABdhPJxYy8Q58aMNR7lk6HpzyFZxWghC+6BecplIycm6kYGXGrDv32FO8mhv/aPZjSwSpfXhu/XHFA== X-Received: by 2002:a37:6744:: with SMTP id b65mr22839051qkc.324.1593011717847; Wed, 24 Jun 2020 08:15:17 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([190.95.18.252]) by smtp.gmail.com with ESMTPSA id c83sm3592539qkb.75.2020.06.24.08.15.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 08:15:17 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id C6F612A3A97; Wed, 24 Jun 2020 11:15:14 -0400 (-04) Date: Wed, 24 Jun 2020 11:15:14 -0400 From: Alvaro Herrera To: Fujii Masao Cc: Kyotaro Horiguchi , amit.kapila16@gmail.com, michael@paquier.xyz, pgsql-hackers@postgresql.org Subject: Re: min_safe_lsn column in pg_replication_slots view Message-ID: <20200624151514.GA17861@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <727f0d64-b720-8f81-0473-56c0278b9a10@oss.nttdata.com> 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-24, Fujii Masao wrote: > On 2020/06/24 8:39, Alvaro Herrera wrote: > > I think we should publish the value from wal_keep_segments separately > > from max_slot_wal_keep_size. ISTM that the user might decide to change > > or remove wal_keep_segments and be suddenly at risk of losing slots > > because of overlooking that it was wal_keep_segments, not > > max_slot_wal_keep_size, that was protecting them. > > You mean to have two functions that returns > > 1. "current WAL LSN - wal_keep_segments * 16MB" > 2. "current WAL LSN - max_slot_wal_keep_size" Hmm, but all the values there are easily findable. What would be the point in repeating it? Maybe we should disregard this line of thinking and go back to Horiguchi-san's original proposal, to wit use the "distance to breakage", as also supported now by Amit Kapila[1] (unless I misunderstand him). [1] https://postgr.es/m/CAA4eK1L2oJ7T1cESdc5w4J9L3Q_hhvWqTigdAXKfnsJy4=v13w@mail.gmail.com -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services