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 1qkeJN-00FQda-Oj for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Sep 2023 05:39:14 +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 1qkeJM-00FEi4-1J for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Sep 2023 05:39:12 +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 1qkeJK-00FEhj-B2 for pgsql-hackers@lists.postgresql.org; Mon, 25 Sep 2023 05:39:11 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qkeJG-007QIz-74 for pgsql-hackers@lists.postgresql.org; Mon, 25 Sep 2023 05:39:09 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id F0DF93200A00; Mon, 25 Sep 2023 01:39:02 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 25 Sep 2023 01:39:03 -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:sender :subject:subject:to:to; s=fm2; t=1695620342; x=1695706742; bh=Og GkN0wfvT6ndMAd8lYK1/6AkLzZUQCj5x8BrM2ZWYE=; b=UzmNfzZqc7gVz3A4bb vGTjmVQ3JVkfs5BcUC6Z4OwC7L+CE+Xis9dvUthq3o8kqWDdAe/bUfqYiIB9lzh2 /PkzfuvQlAjBps1hHrPfTm/yEaGBU6wcXlS9pcFwRpIKXnY4CHO1oeBKwt6q220K 7giRmqNtel5uL4/AUt583saHEsFAYNHZv2xFrr7W7XCqtPoK3/mwjf248tcK84Na qziqXY7KPTQnOlywQqezivl92MCxXhGNhH9plSnGS3yxlDwAVdBdLkRAiLqLHtrl 6YbJ748gKJfBvWSXHfN5GnOWx35lRB37xm6QGCz9yibH5IhQLmKtmLcFCy0ZOgPc /fhg== 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:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1695620342; x=1695706742; bh=OgGkN0wfvT6nd MAd8lYK1/6AkLzZUQCj5x8BrM2ZWYE=; b=bl/eNy6pTZTrWw/I7nKSmOZHtGwT6 pl0xhVX0nwTSAJB8ckXf2ickty8Inh/IV6F+6EfWCjDXOsiZRasj8LLZWR736Q/j RpqEfVM72IvczxocnnJP4hNWgX0cvw7G5xi7ObxU4lExy2pRpkClUz/n8ubCRa74 GhO3whymrI5sXNrYKG8O+cpjJilsXjBtHBzaLkXulD2cgM1uFcGiQ+LitxZaOD44 Oswiji0Y/87T6mlKT6R/JcOHJhD1/qzQ2SQJN+jBfusb2jBQV+9r4ZwBi+dk6wwc uV7kjCZ67m2Yop7ftAEBaOON1MbjDBwvAWaOP6qPZsohCr8J6YrRSqqAw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudelfedgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpeffhf fvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghq uhhivghruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvg hrnhepteelieefudffhffhtdetleeggeegfffhkeeuveetiefgudduvedutefggeeivdej necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitg hhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 25 Sep 2023 01:39:00 -0400 (EDT) Date: Mon, 25 Sep 2023 14:38:57 +0900 From: Michael Paquier To: Ryoga Yoshida Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Doesn't pgstat_report_wal() handle the argument "force" incorrectly Message-ID: References: <2f6f68343fcd244ef7be5dfae8e55f63@oss.nttdata.com> <5adaf4e34fca5612ff506b47f6e81e47@oss.nttdata.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="s+UcC3czUn1+xN5q" Content-Disposition: inline In-Reply-To: <5adaf4e34fca5612ff506b47f6e81e47@oss.nttdata.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --s+UcC3czUn1+xN5q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 25, 2023 at 02:16:22PM +0900, Ryoga Yoshida wrote: > On 2023-09-25 12:47, Michael Paquier wrote: > in attached file >> + /* like in pgstat.c, don't wait for lock acquisition when !force */ >=20 > Isn't it the case with force=3Dtrue and !force that it doesn't wait for t= he > lock acquisition. In fact, force may be false. We would not wait on the lock if force=3Dfalse, which would do nowait=3Dtrue. And !force reads the same to me as force=3Dfalse. Anyway, I am OK to remove this part. That seems to confuse you, so you may not be the only one who would read this comment. Another idea would be to do like in pgstat.c by adding the following line, then use "nowait" to call each sub-function: nowait =3D !force; pgstat_flush_wal(nowait); pgstat_flush_io(nowait); -- Michael --s+UcC3czUn1+xN5q Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmURHPEACgkQnvQgOdby QH2Klg/7BXgRGZfZBVUwBIVfjy/3ipibe9nP4R83EXXsGUrIAhVk3H9YntAbaRsD gLYt36IkO0zOeDdBkAVqik3u5as/uOm0JYCmPbvqtDKNxurJqWvQuQbFPZWXlfjL ZbwvrE+7O0K7lkoFlksaLHGrnwJ0zG5B+x3X14XhA7zFXW4P4gc887KyRggKzqSC +bxBScPqgMh9FwjkWSv+zZNU21a08aExq5/vauCj0QNQmkUWsD9hH7XeYa++w/7d epxYwbBQXLwKOV1SneOaIFPul9QwKAIMHpbAUrAIdw9/kmNeyACTfiL9Htjbj/X6 EiQQ/rjuljgzdy8qKlh/Opj46bsr8efxoJVPz/YanuRzz+fec/o/WY5WhDwOEOn8 tw1e1SRa/W3MZZ4d4YHFgpVkQOA5ra/ZbmGZhgYdABVcDUSg4a4L2S2YOw0bQi5W EElB0jo10eOqwqGA07wmt7luV8hXa5/13zhjdRz3V/qXM7HmIrxCDXsXdhgYXLOx T4bczKDVsm8e4k9+cMKssRrdmnRlqtOz11SbUkZCVPF1R55FHfvl2QVKu4QwI0DY 7MUhYwbE0sgSEoySKcyiiZs8KTB9duMslw/mqCwK58dSlAQ8u0jEI0nc+JFVuz9H FzmvcbowTaWmajI/CFb6t5ggTOZndp9wLDqQZf+NsH0naK9XRmk= =Kka2 -----END PGP SIGNATURE----- --s+UcC3czUn1+xN5q--