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 1snU1m-003tZR-U2 for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Sep 2024 02:21:19 +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 1snU1m-004QKr-IQ for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Sep 2024 02:21:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1snU1m-004QJP-8q for pgsql-hackers@lists.postgresql.org; Mon, 09 Sep 2024 02:21:18 +0000 Received: from fhigh4-smtp.messagingengine.com ([103.168.172.155]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1snU1i-000E4O-Pl for pgsql-hackers@lists.postgresql.org; Mon, 09 Sep 2024 02:21:17 +0000 Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id 4463F11401B0; Sun, 8 Sep 2024 22:21:14 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Sun, 08 Sep 2024 22:21:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1725848474; x=1725934874; bh=TR4M/4izCw AUv/c1Xe5JVfvSpbs31Ye+9BgctAhcC0o=; b=OuuLrsMkl3EDPv1DJdhUKdD4au giH430gZXNQRASrnuy1XHK87mhjqWGnmdzdMXGageRk1yqI44OOi3RSfmmhBCIlj bAq5jI2CSl0znTIPuJwxSJruqTKh7AGeW3RKTHIvtjrMavlqA7pLqBUhj+ZsPN9B +IrdOGZwPEPfiu7U97DUAcnsgBbupqkIswzd7vR/ElH9v/j7uCMyRhQEKw/hniJb S41rBZhaUynZc4YzgMNqBNffkB85gOh97vRU3/MfGtIyCbqxZ15xeCpaFf6YnWdi b6Apk4DrQnTjuGNqjE3/7p/rRam+Tf2RyVrBj30qiw/ddqKvP7pqDdG1kQ2A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1725848474; x=1725934874; bh=TR4M/4izCwAUv/c1Xe5JVfvSpbs3 1Ye+9BgctAhcC0o=; b=dI31uWBIqJ9HctnZQuGzyGnOe0LEv82lM3qBoCP+MV/c NkACa6pluhAqLJhGmBkXk14AKfdJHbGZEFLwfFqlR9D1gRj9/kv9qfoF5eXKqioq FR7Y62yAJA3WoMpFS/nMAQ9PFo7VQjdjU8mdxXLi9aFUYLgLkmN12MvAZ0Y9r5jV GFCZBuqufrZwx0nuaxmAGCFIhKT8N1J6aDkfVGNFa9tdu1toiZ+x1v29N3VEDNMw z3CptGB8KMKi4eqk1jqd4jplWQjmbJxQn1TiVgRPkQjS7O6mZQPEmaKGcz4vy1MZ Y/dWylOV4PTB8rt5kpupF6fCPT2/q0iRvOu0wFnTWg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudeiiedgheejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdlje dtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefo ihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihii eqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeggeegfffhkeeuveetiefg udduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidpnhgspghrtghpthht ohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepsggvrhhtrhgrnhguughroh huvhhothdrphhgsehgmhgrihhlrdgtohhmpdhrtghpthhtohephhhorhhikhihohhtrgdr nhhtthesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhsse hlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 8 Sep 2024 22:21:12 -0400 (EDT) Date: Mon, 9 Sep 2024 11:20:54 +0900 From: Michael Paquier To: Bertrand Drouvot Cc: Kyotaro Horiguchi , pgsql-hackers@lists.postgresql.org Subject: Re: Add callbacks for fixed-numbered stats flush in pgstats Message-ID: References: <20240904.140546.948122275033564187.horikyota.ntt@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="1QBcUzXLviyeJ5JP" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --1QBcUzXLviyeJ5JP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Sep 04, 2024 at 06:27:43AM +0000, Bertrand Drouvot wrote: > Agree. The idea was to add an additional parameter (say "check_only") to the > flush_fixed_cb. If this parameter is set to true then the flush_fixed_cb would > do nothing (no flush at all) but return a boolean that would indicate if there > is pending stats. In case it returns false, then we could avoid the clock check. Hmm. It's the same thing in terms of logic, but I am not really convinced that it is a good idea to mix a code path for a sanity check with a code path dealing with the action, particularly considering that there is the nowait option to think about in the flush callback which would require one to think about 4 possible states rather than two possibilities. So that's more error-prone for extension developers, IMO. At the end, I have used my original suggestions for the callbacks. If there are voices in favor of something different, we still have a good chunk of the development and beta cycle for that. -- Michael --1QBcUzXLviyeJ5JP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmbeW4YACgkQnvQgOdby QH2NAA//eBxmaPRSoB+v2C2e8b8J9SVogR1s4kV5ZHIUR88LqoFvJ9YJ83cL1j2F DxJsDMCD95u8HZiUsnUUlqBvCypmJo0R0p6QLWBiBruYd8UL7LHML2pQPvEhgvJE UQ0KuIy58ruUWq2dRrAYTYtCLz/qve+JaWouCDWp080EdBHG/9gNJwG9h6A0N+rx 1dnhhvebU0FuTsIf9+TRtKgj8MWMlTww5GKQ5ornDmnc+A165xz3Igpq0Rh9vA84 6BBKq9/wU3HsMQgTYKJ6ymnIfRAYWCCVMAjOCHG9KbVwexiB6yCWo32/DvpwgypK b5iW0hfSG1yY87SKjVvvTxzhrOV1qPE10AKKvUDSH7ZccvrqIttsn0Jd8Pb/egaT xnuRJ80bkAVATg+ONjuG5tMhVFUybKzriBM0tvhAf5s0okuTIUYUnrzw9n2VUoQ6 Wl0cI9VgKYBYO6/UOk71vm5eggQL2v1avu7S5X1asl5TDAwYSFIrb95NjgMfXFms ExdAr4014g1jAe5xf86f5rX4k4pS/WbKviD4RIYxgPvZjpmm24ucjT6Zli7817nu ud+RZxTQ+qwFG3v7cwG4Cn8rTjbwX70Z3BgwcUSTjK3f0oyueBTZ1k+sw+7HJktm apU2WHVDMQj7OaeOUz49DbEgM/36qE2TuXdv86Q0djOox6y8+eU= =r1XR -----END PGP SIGNATURE----- --1QBcUzXLviyeJ5JP--