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 1ovMvt-0005DG-Pt for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Nov 2022 18:14:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ovMvs-0003qP-IC for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Nov 2022 18:14:44 +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 1ovMvr-0003mc-H0 for pgsql-hackers@lists.postgresql.org; Wed, 16 Nov 2022 18:14:44 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ovMvk-0005mQ-2V for pgsql-hackers@lists.postgresql.org; Wed, 16 Nov 2022 18:14:42 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id F168C5C00E6; Wed, 16 Nov 2022 13:14:34 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 16 Nov 2022 13:14:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1668622474; x=1668708874; bh=6c2fdYpBfJ 349p5B34D+gSCPAB3hr1IuaF4+s83hDjI=; b=CMmgp7VJaNglKATRYsip7Xalad Mz3PFaGR/8C/SrLBTyGPzuRsG8qmJAsuvCVx/qx98fowSUcF335RaE4wd+MfSNMJ f67v4i4t8scMrfkwmCopMI49PYbQyP3Yalx/Fjc3ajC/H4XLfpfEETf08KwEVcHS BHD3RixorHjS53U7el9Gc1dyCxTKxmjToAtT03MhLlgSIG+eMHkT131oIayTZWdo m0EfMNKQeGiMwxLsesnT7KYaHUH8UDjdfUmWNTexkA597UEGHTpZ1LFJtPjEmnod xZ/Q85PqJiq+3wpGrxMTKyeTOICLsag5vUtyqysC8VK4c5RDkj6wYMCHSu8A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1668622474; x=1668708874; bh=6c2fdYpBfJ349p5B34D+gSCPAB3h r1IuaF4+s83hDjI=; b=hrh7BzgJC6WzhABujjfDJGR8dMtVFXzT5tkwqIluwakR 3w3CA55RwcO3vaJ7fyZN7qGot9tXH4mpkDGdMvtll/+6zG/3NwGq9l0BqbP0Nbl1 clwyDAIB5K1Cr7ct2SpQS5W9MgFTHq3qxUhKsVVLGeqr8G/3IOucq3aS6DFL7gQz M00t5DxxkMmD8WMISA3Ofh2i8qlFiYIPUZ0HQUOXIkJyxUndwMYkxxqNQQDQIRx2 dTX3iihkSCjh9q6crEODbLgepWA8cJtWHDyJXFXwpVSnjzPzSvfAj8ik148HqKcr 6eG+Qf0qnRETw0jxaFxzI92mZ++0yMm5doo5kUVcEA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgeeigdduuddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnhepvdfffeevhfetveffgeeiteefhfdtvdffjeevhfeuteegleduheetvedu ieettddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 16 Nov 2022 13:14:34 -0500 (EST) Date: Wed, 16 Nov 2022 10:14:33 -0800 From: Andres Freund To: Bharath Rupireddy Cc: Robert Haas , "Drouvot, Bertrand" , Nitin Jadhav , Matthias van de Meent , Ashutosh Sharma , Julien Rouhaud , Bruce Momjian , Tom Lane , Magnus Hagander , PostgreSQL Hackers Subject: Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs) Message-ID: <20221116181433.y2hq2pirtbqmmndt@awork3.anarazel.de> References: <20220319001556.atuqbmafvc73pa2k@alap3.anarazel.de> <20220707000446.hefgyu5xikxwt4md@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2022-11-16 16:01:55 +0530, Bharath Rupireddy wrote: > -1 for CheckpointerShmemStruct as it is being used for running > checkpoints and I don't think adding stats to it is a great idea. Why? Imo the data needed for progress reporting aren't really "stats". We'd not accumulate counters over time, just for the current checkpoint. I think it might even be useful for other parts of the system to know what the checkpointer is doing, e.g. bgwriter or autovacuum could adapt the behaviour if checkpointer can't keep up. Somehow it'd feel wrong to use the stats system as the source of such adjustments - but perhaps my gut feeling on that isn't right. The best argument for combining progress reporting with accumulating stats is that we could likely share some of the code. Having accumulated stats for all the checkpoint phases would e.g. be quite valuable. > Instead, extending PgStat_CheckpointerStats and using shared memory > stats for reporting progress/last checkpoint related stats is a good > idea IMO There's certainly some potential for deduplicating state and to make stats updated more frequently. But that doesn't necessarily mean that putting the checkpoint progress into PgStat_CheckpointerStats is a good idea (nor the opposite). > I also think that a new pg_stat_checkpoint view is needed > because, right now, the PgStat_CheckpointerStats stats are exposed via > the pg_stat_bgwriter view, having a separate view for checkpoint stats > is good here. I agree that we should do that, but largely independent of the architectural question at hand. Greetings, Andres Freund