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 1r0a1a-006S3t-2u for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Nov 2023 04:18:42 +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 1r0a1Y-00Fcg6-NL for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Nov 2023 04:18:40 +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 1r0a1Y-00Fcfy-9Q for pgsql-hackers@lists.postgresql.org; Wed, 08 Nov 2023 04:18:40 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0a1R-004VCt-AX for pgsql-hackers@postgresql.org; Wed, 08 Nov 2023 04:18:38 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A9BFE5C00CC; Tue, 7 Nov 2023 23:18:32 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 07 Nov 2023 23:18:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-transfer-encoding:content-type: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=fm3; t= 1699417112; x=1699503512; bh=DSdVIX4/HJskP79uI12YbY9SPklH/5WQe03 XgjAaDzo=; b=KPTH/r8pTfV4pzip9D8EXX3jTpKJIZXTdANEj31Pb0QVulGmmqh 9YgP6Za+0evVv/Ez4EmyKr/Ul73z6sUxm+3EBD2KeJMM53T7XCrdBQXixzXUwWfY UzHHz1pKxLew7JD37fMn5RtAPq6woKF2TGYdh9btp6kgSe1Pdel+XJnwK6Be3RJx o/PDRzRTTjQUg668J7UmqkKlvn/a+eehUschlCLHrFTUIDwHA9f3WzVbw+QFnbUM jl6OqsnHu/kOY2538qPMlNsv+EcitzNxVxCqv8XCpX9Mpxh90V1R7/14b+ajg1Bi 4rN2paQrMbspVMI1DvUPYc/+qE+KX5W7CZQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type: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=fm3; t= 1699417112; x=1699503512; bh=DSdVIX4/HJskP79uI12YbY9SPklH/5WQe03 XgjAaDzo=; b=lsuOddEnTled6KgzPUNumvEWc4qAN/H0K6lKeixtvRRAMxRwuBF DroYrTmBEdS60zoGm627gLQxPpTIMb2VIcVCMDKcvbewP2pHTCmXaX2gD75qE+1U /m0C0g0eagDgQY/OET+wahnqhPk8xQAlCaj9dQESwuzzV6I6RR0dTyO+YxXPQTuE JiGP7sJ+mF9aN/YRXie4pjKjhPK/BvDCZCf1DMOOpv/uLbnAUZPZcEmZasteT0SL H2XS2KWSDIfRwZgjDE1zJ5VU8wy3jqrOTfSvWsUsyzQwaJR3M8Bl3KQ9YRjTL7VR g3NyxAJ74BL4HgPm6X4Ac2+0a2/bbe7vQcA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddukedgieekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvvefukfhfgggtugfgjgesth ekredttddtjeenucfhrhhomheptehnughrvghsucfhrhgvuhhnugcuoegrnhgurhgvshes rghnrghrrgiivghlrdguvgeqnecuggftrfgrthhtvghrnhephfeitefgleevtedtffejve dujeekjedugfdtveffjeelvddtfeekgefgjefhgfegnecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomheprghnughrvghssegrnhgrrhgriigvlhdrug gv X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 Nov 2023 23:18:32 -0500 (EST) Date: Tue, 7 Nov 2023 20:18:30 -0800 From: Andres Freund To: Kyotaro Horiguchi Cc: bharath.rupireddyforpostgres@gmail.com, torikoshia@oss.nttdata.com, boekewurm+postgres@gmail.com, michael@paquier.xyz, pgsql-hackers@postgresql.org Subject: Re: Add new option 'all' to pg_stat_reset_shared() Message-ID: <20231108041830.5ffp5v3dellbeibt@awork3.anarazel.de> References: <20231104014905.oiropxau5can5fdu@awork3.anarazel.de> <20231108.100842.899919087426357988.horikyota.ntt@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231108.100842.899919087426357988.horikyota.ntt@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2023-11-08 10:08:42 +0900, Kyotaro Horiguchi wrote: > At Mon, 6 Nov 2023 14:00:13 +0530, Bharath Rupireddy wrote in > > On Mon, Nov 6, 2023 at 11:39 AM torikoshia wrote: > > > Since each stats, except wal_prefetch was reset acquiring LWLock, > > > attached PoC patch makes the call atomic by using these LWlocks. > > > > > > If this is the right direction, I'll try to make wal_prefetch also take > > > LWLock. > > I must say, I have reservations about this approach. The main concern > is the duplication of reset code, which has been efficiently > encapsulated for individual targets, into this location. This practice > degrades the maintainability and clarity of the code. Yes, as-is this seems to evolve the code in precisely the wrong direction. We want less central awareness of different types of stats, not more. The proposed new code is far longer than the current pg_stat_reset(), despite doing something conceptually simpler. Greetings, Andres Freund