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 1nEvj6-0005QF-Va for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Feb 2022 16:09:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nEvj5-0000id-DP for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Feb 2022 16:09:51 +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 1nEvj5-0000iT-3J for pgsql-hackers@lists.postgresql.org; Tue, 01 Feb 2022 16:09:51 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nEvj2-00010i-5S for pgsql-hackers@lists.postgresql.org; Tue, 01 Feb 2022 16:09:50 +0000 Received: from [192.168.11.9] (p2019072-ipbf2307funabasi.chiba.ocn.ne.jp [122.30.130.72]) by oss.nttdata.com (Postfix) with ESMTPSA id E5D2760427; Wed, 2 Feb 2022 01:09:43 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.5 at oss.nttdata.com Message-ID: Date: Wed, 2 Feb 2022 01:09:43 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: Add checkpoint and redo LSN to LogCheckpointEnd log message Content-Language: en-US To: Bharath Rupireddy , Kyotaro Horiguchi Cc: Nathan Bossart , Stephen Frost , "Bossart, Nathan" , Julien Rouhaud , Michael Paquier , PostgreSQL Hackers References: <20220201.152756.1157327790387186473.horikyota.ntt@gmail.com> From: Fujii Masao In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022/02/01 22:03, Bharath Rupireddy wrote: > On Tue, Feb 1, 2022 at 11:58 AM Kyotaro Horiguchi > wrote: >>> Modified in v8. >> >> 0001 looks good to me. I found that CreateRestartPoint() already reported the redo lsn as follows after emitting the restartpoint log message. To avoid duplicated logging of the same information, we should update this code? ereport((log_checkpoints ? LOG : DEBUG2), (errmsg("recovery restart point at %X/%X", LSN_FORMAT_ARGS(lastCheckPoint.redo)), xtime ? errdetail("Last completed transaction was at log time %s.", timestamptz_to_str(xtime)) : 0)); This code reports lastCheckPoint.redo as redo lsn. OTOH, with the patch, LogCheckpointEnd() reports ControlFile->checkPointCopy.redo. They may be different, for example, when the current DB state is not DB_IN_ARCHIVE_RECOVERY. In this case, which lsn should we report as redo lsn? + "lsn=%X/%X, redo lsn=%X/%X", Originally you proposed to use upper cases for "lsn". But the latest patch uses the lower cases. Why? It seems better to use upper cases, i.e., LSN and REDO LSN because LSN is basically used in other errmsg(). > Attaching the above changes 0003 (0001 and 0002 remain the same). If > the committer doesn't agree on the text or wording in 0003, I would > like the 0001 and 0002 to be taken here and I can start a new thread > for discussing 0003 separately. Personally I'm ok with 001, but regarding 0002 and 0003 patches, I'm not sure if it's really worth replacing "location" with "lsn" there. BTW, the similar idea was proposed at [1] before, but seems "location" was left as it was. [1] https://postgr.es/m/20487.1494514594@sss.pgh.pa.us Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION