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 1jbDOz-0004dW-Jg for pgsql-hackers@arkaria.postgresql.org; Wed, 20 May 2020 01:20:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jbDOx-0003JD-Uw for pgsql-hackers@arkaria.postgresql.org; Wed, 20 May 2020 01:20:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jbDOx-0003It-Nr for pgsql-hackers@lists.postgresql.org; Wed, 20 May 2020 01:20:07 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jbDOs-0003lH-Kf for pgsql-hackers@lists.postgresql.org; Wed, 20 May 2020 01:20:06 +0000 Received: from hnk.local (p1864124-ipbf1405funabasi.chiba.ocn.ne.jp [123.216.143.124]) by oss.nttdata.com (Postfix) with ESMTPSA id 0EFA960524; Wed, 20 May 2020 10:19:57 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.2 at oss.nttdata.com Subject: Re: pg_stat_wal_receiver and flushedUpto/writtenUpto To: Michael Paquier Cc: Alvaro Herrera , Postgres hackers , Thomas Munro References: <20200515230539.GC212736@paquier.xyz> <20200515233446.GA334@alvherre.pgsql> <20200516011547.GD212736@paquier.xyz> <20200517010857.GI212736@paquier.xyz> <20200519233129.GA2355@paquier.xyz> From: Fujii Masao Message-ID: <00fb7551-24e5-375b-2dd4-5ea3441458cd@oss.nttdata.com> Date: Wed, 20 May 2020 10:19:56 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200519233129.GA2355@paquier.xyz> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020/05/20 8:31, Michael Paquier wrote: > On Tue, May 19, 2020 at 11:38:52PM +0900, Fujii Masao wrote: >> I found that "received_lsn" is still used in high-availability.sgml. >> We should apply the following change in high-availability? >> >> - view's received_lsn indicates that WAL is being >> + view's flushed_lsn indicates that WAL is being > > Oops, thanks. Will fix. Thanks for the fix! > >> BTW, we have pg_last_wal_receive_lsn() that returns the same lsn as >> pg_stat_wal_receiver.flushed_lsn. Previously both used the term "receive" >> in their names, but currently not. IMO it's better to use the same term in >> those names for the consistency, but it's not good idea to rename >> pg_last_wal_receive_lsn() to something like pg_last_wal_receive_lsn(). >> I have no better idea for now. So I'm ok with the current names. > > I think you mean renaming pg_last_wal_receive_lsn() to something like > pg_last_wal_flushed_lsn(), no? No, that's not good idea, as I told upthread. > This name may become confusing because > we lose the "receive" idea in the function, that we have with the > "receiver" part of pg_stat_wal_receiver. Maybe something like that, > though that's long: > - pg_last_wal_receive_flushed_lsn() > - pg_last_wal_receive_written_lsn() Yes, that's long. > Anyway, a rename of this function does not strike me as strongly > necessary, as that's less tied with the shared memory structure, and > we document that pg_last_wal_receive_lsn() tracks the current LSN > received and flushed. I am actually wondering if in the future it may > not be better to remove this function, but it has no maintenance > cost either so I would just let it as-is. Yeah, agreed. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION