Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sp86R-00Gq5N-LD for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Sep 2024 15:20:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sp86R-0059F7-AJ for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Sep 2024 15:20:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sp86Q-0059C9-Vx for pgsql-hackers@lists.postgresql.org; Fri, 13 Sep 2024 15:20:54 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sp86N-000z7J-HT for pgsql-hackers@lists.postgresql.org; Fri, 13 Sep 2024 15:20:53 +0000 Received: from [192.168.11.4] (p3816179-ipxg13401funabasi.chiba.ocn.ne.jp [118.1.101.179]) by oss.nttdata.com (Postfix) with ESMTPSA id 502DC615BD; Sat, 14 Sep 2024 00:20:47 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at oss.nttdata.com Message-ID: <9ea77f40-818d-4841-9dee-158ac8f6e690@oss.nttdata.com> Date: Sat, 14 Sep 2024 00:20:46 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: May be BUG. Periodic burst growth of the checkpoint_req counter on replica. Content-Language: en-US To: Alexander Korotkov , "Anton A. Melnikov" Cc: Magnus Hagander , "Anton A. Melnikov" , Andres Freund , Kyotaro Horiguchi , pgsql-hackers@lists.postgresql.org References: <99b2ccd1-a77a-962a-0837-191cdf56c2b9@inbox.ru> <20220907.163946.2214338139097492905.horikyota.ntt@gmail.com> <84b732cb-2eef-1d4c-e9f3-48514d492f55@inbox.ru> <20221206184453.ebr4eqwbnwfxl476@awork3.anarazel.de> <42223bc5-23ad-c129-7779-92df92b21bae@inbox.ru> <7bd1c12b-4219-45bf-88a6-8cacd008dfdc@postgrespro.ru> <3ed0590b-8132-482e-a9e6-bd694e4a48d7@postgrespro.ru> From: Fujii Masao In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024/03/14 9:19, Alexander Korotkov wrote: > On Mon, Mar 11, 2024 at 11:48 AM Alexander Korotkov > wrote: >> >> On Mon, Mar 11, 2024 at 5:43 AM Anton A. Melnikov >> wrote: >>> On 11.03.2024 03:39, Alexander Korotkov wrote: >>>> Now that we distinguish stats for checkpoints and >>>> restartpoints, we need to update the docs. Please, check the patch >>>> attached. >>> >>> Maybe bring the pg_stat_get_checkpointer_buffers_written() description in consistent with these changes? >>> Like that: >>> >>> --- a/src/include/catalog/pg_proc.dat >>> +++ b/src/include/catalog/pg_proc.dat >>> @@ -5740 +5740 @@ >>> - descr => 'statistics: number of buffers written by the checkpointer', >>> + descr => 'statistics: number of buffers written during checkpoints and restartpoints', >> >> This makes sense. I've included this into the revised patch. > > Pushed. If I understand correctly, restartpoints_timed and restartpoints_done were separated because a restartpoint can be skipped. restartpoints_timed counts when a restartpoint is triggered by a timeout, whether it runs or not, while restartpoints_done only tracks completed restartpoints. Similarly, I believe checkpoints should be handled the same way. Checkpoints can also be skipped when the system is idle, but currently, num_timed counts even the skipped ones, despite its documentation stating it's the "Number of scheduled checkpoints that have been performed." Why not separate num_timed into something like checkpoints_timed and checkpoints_done to reflect these different counters? Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION