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 1ncbhS-0004HA-74 for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Apr 2022 23:38:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ncbhP-00006w-O3 for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Apr 2022 23:37:59 +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 1ncbhP-00006G-F5 for pgsql-hackers@lists.postgresql.org; Thu, 07 Apr 2022 23:37:59 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ncbhM-000850-Pq for pgsql-hackers@lists.postgresql.org; Thu, 07 Apr 2022 23:37:58 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id F3E1432021EF; Thu, 7 Apr 2022 19:37:53 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 07 Apr 2022 19:37:54 -0400 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; bh=3mJzWv/GSxVeISDW53RUGiJmVXi10k/7nMwL4p vItnI=; b=J1KxDSgb1pUlY0pryNQjFbJVd998wJtV846Wc2coPYj0fEbm/wXqv7 ZreGEQ5PMyho0WmUZXhhsRnuHKRZS3pynbZfvcSJQKnX+8x70j688Xa8H3NFe17r SLHQTIWIbZyjGMbSPslCSiu+AO0C/KC3nCGfU9RbD3nrf9eRNv04Ov003RUdTWlQ Xssk70t+Vdo+rGCil13cVsrResjbyWCAtqqgmWn4YVYNMKrVQCITuV37zaAbkHCq sGs1eOP+ewpCOh3EXtJHgBllvH0AjyhXe6/LMsy177RjmNAcTwpy5YdYOtVal+RV 51yPzbx15tWIrzwTdWPkJP6tkFNUeZWw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; 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:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=3mJzWv/GSxVeISDW5 3RUGiJmVXi10k/7nMwL4pvItnI=; b=joFHqwZwiK2egnwdc6R8FSEbHi4KqjrmY u/d0BG0eOq0b+7neuB2uSSQMNLbd/gUHsaH8UEcAci4qUTkubYpIWBW3ceojCgxW EDp3YuFZ81UXADa3kX+sMZMn0bkMihW65okcQNrR7YFNi9EFZ3ZwKuKOeYWAecHs W3NXW4NexILjMEEbOlb0JEYDynYj9kG1eHRxT9P5D5elfGGzKYKbtYkIWLJ+xjfi Ln4GUq16SJ6VIsPnkM2Et+sU6+tMPIydWNHtIu194ZSgkQ0yGXrHHu9NewHhBGwE umqCHlwNCyDbuIOK6ZObO8f6fX53fzpx5S7tgkpa73F2rWJWKNvLQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudejledgvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrg htthgvrhhnpeetheehiefgudelhfevvddvtdejheehkeelteekveeggeduieelieduuefg fedtjeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghnughrvghssegrnhgrrhgr iigvlhdruggv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 7 Apr 2022 19:37:52 -0400 (EDT) Date: Thu, 7 Apr 2022 16:37:51 -0700 From: Andres Freund To: Kyotaro Horiguchi Cc: melanieplageman@gmail.com, Justin Pryzby , Thomas Munro , "David G. Johnston" , pgsql-hackers@lists.postgresql.org Subject: Re: shared-memory based stats collector - v70 Message-ID: <20220407233751.i573vgmuwicphd2t@alap3.anarazel.de> References: <20220317073652.kz3uuh6le6vbfod4@alap3.anarazel.de> <20220325.142256.1649716600998659084.horikyota.ntt@gmail.com> <20220325.172418.1055357550509939415.horikyota.ntt@gmail.com> <20220402082102.ojdd2e6cobsmljvh@alap3.anarazel.de> <20220404041516.cctrvpadhuriawlq@alap3.anarazel.de> <20220405030506.lfdhbu5zf4tzdpux@alap3.anarazel.de> <20220406030008.2qxipjxo776dwnqs@alap3.anarazel.de> <20220407072845.mwz7ybaode32kk26@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220407072845.mwz7ybaode32kk26@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2022-04-07 00:28:45 -0700, Andres Freund wrote: > I've gotten through the main commits (and then a fix for the apparently > inevitable bug that's immediately highlighted by the buildfarm), and the first > test. I'll call it a night now, and work on the other tests & docs tomorrow. I've gotten through the tests now. There's one known, not yet addressed, issue with the stats isolation test, see [1]. Working on the docs. Found a few things worth raising: 1) Existing text: When the server shuts down cleanly, a permanent copy of the statistics data is stored in the pg_stat subdirectory, so that statistics can be retained across server restarts. When recovery is performed at server start (e.g., after immediate shutdown, server crash, and point-in-time recovery), all statistics counters are reset. The existing docs patch hadn't updated yet. My current edit is When the server shuts down cleanly, a permanent copy of the statistics data is stored in the pg_stat subdirectory, so that statistics can be retained across server restarts. When crash recovery is performed at server start (e.g., after immediate shutdown, server crash, and point-in-time recovery, but not when starting a standby that was shut down normally), all statistics counters are reset. but I'm not sure the parenthetical is easy enough to understand? 2) The edit is not a problem, but it's hard to understand what the existing paragraph actually means? diff --git a/doc/src/sgml/high-availability.sgml b/doc/src/sgml/high-availability.sgml index 3247e056663..8bfb584b752 100644 --- a/doc/src/sgml/high-availability.sgml +++ b/doc/src/sgml/high-availability.sgml @@ -2222,17 +2222,17 @@ HINT: You can then restart the server after making the necessary configuration ... - The statistics collector is active during recovery. All scans, reads, blocks, + The cumulative statistics system is active during recovery. All scans, reads, blocks, index usage, etc., will be recorded normally on the standby. Replayed actions will not duplicate their effects on primary, so replaying an insert will not increment the Inserts column of pg_stat_user_tables. The stats file is deleted at the start of recovery, so stats from primary and standby will differ; this is considered a feature, not a bug. I'll just commit the necessary bit, but we really ought to rephrase this. Greetings, Andres Freund [1] https://www.postgresql.org/message-id/20220407165709.jgdkrzqlkcwue6ko%40alap3.anarazel.de