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 1tnt8G-003Fy7-8I for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Feb 2025 05:41:57 +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 1tnt8G-00Ef6y-Qz for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Feb 2025 05:41:55 +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 1tnt8G-00Ef6p-1H for pgsql-hackers@lists.postgresql.org; Fri, 28 Feb 2025 05:41:55 +0000 Received: from fhigh-a5-smtp.messagingengine.com ([103.168.172.156]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tnt8A-0007EB-1M for pgsql-hackers@lists.postgresql.org; Fri, 28 Feb 2025 05:41:54 +0000 Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfhigh.phl.internal (Postfix) with ESMTP id E478611403E8; Fri, 28 Feb 2025 00:41:48 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Fri, 28 Feb 2025 00:41:48 -0500 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=1740721308; x=1740807708; bh=9WMolDyuai 5G47z9qmvq+nI55ovthia1bqKdJ+dQ5Bs=; b=Fa1BKbBVJL4fxAhoZFIHliLh2q mVjNQu6E8ogwv8sEVCribchqDGSF8rMorlqtiXe7aonNVi8b61JMLemIUg8LAK8t 02x6hUHiKq5YJYBJ8w49wb+8LnRuh38vVlFrpOz5vYb8IO2sh93c3exQf8eQiMkq DFIqLcLXxTAOZM5bx2kZXnRYzVq5dV6c3QCnVJPNOwT1m2TOj/PjrSv+mayaXhl6 lJYEvcS6wQdpDbJ5Dch1sVc+xuG2OwyeaWsouh6L1euvAXsnHh/63d+YAWFogHN2 6WsnZPahwVlcguDhdyhePQ6K6z3flkZAnb3AMuY3HT0DOfraKuulapRj3Trg== 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-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1740721308; x=1740807708; bh=9WMolDyuai5G47z9qmvq+nI55ovthia1bqK dJ+dQ5Bs=; b=GTC2DxQfBWDEbcNEJpgM4Kd/+bXToAyew8/gfELpr4UxvWZ3IR5 xPTrqGjd2ty/dEDMfQ8dpc7xea4okdSLSvWhr15Jcxmn/G0zipKHdM8xVURwWTB/ dK7IfabQWgZkJDMbN6eqd3lSKNpa1SGm3exRVOiQK+hs3Nx6T3vwiYivaleFclmv xGFLunoeF4G7pq/CV4l1e/1T43HX5MCzlKJNwGkXJorkuRXTrWWDqrqW7Faf0Vt6 DLzCgftdDLR3JdMOucJMLFRGjwDAAvAgevVfQxuQPW8UPIt8c/1/a69mnjMZtM3l mYS76jIRtCyK4PyJj9kFZ95wJJ5YPDfItEQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdekleehjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecufghrlhcuvffnffculd ejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomhep ofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighi iiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeggeffhfekueevteei gfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiipdhnsggprhgtphht thhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegsvghrthhrrghnuggurh houhhvohhtrdhpghesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggt khgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 28 Feb 2025 00:41:47 -0500 (EST) Date: Fri, 28 Feb 2025 14:41:34 +0900 From: Michael Paquier To: Bertrand Drouvot Cc: pgsql-hackers@lists.postgresql.org Subject: Re: [BUG]: the walsender does not update its IO statistics until it exits Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="a8HV9FOIU3JiWApk" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --a8HV9FOIU3JiWApk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 26, 2025 at 09:48:50AM +0000, Bertrand Drouvot wrote: > Yeah I think that makes sense, done that way in the attached. >=20 > Speaking about physical walsender, I moved the test to 001_stream_rep.pl = instead > (would also fail without the fix). Hmm. I was doing some more checks with this patch, and on closer look I am wondering if the location you have chosen for the stats reports is too aggressive: this requires a LWLock for the WAL sender backend type taken in exclusive mode, with each step of WalSndLoop() taken roughly each time a record or a batch of records is sent. A single installcheck with a primary/standby setup can lead to up to 50k stats report calls. With smaller records, the loop can become hotter, can't it? Also, there can be a high number of WAL senders on a single node, and I've heard of some customers with complex logical decoding deployments with dozens of logical WAL senders. Isn't there a risk of having this code path become a point of contention? It seems to me that we should benchmark this change more carefully, perhaps even reduce the frequency of the report calls. -- Michael --a8HV9FOIU3JiWApk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmfBTI4ACgkQnvQgOdby QH25og//VPndYMDQAazIw9p7aeS19kcJ0cdexlDQJg0NUT/ol2hrwdpRHpUHEOYT UQPjZEnvGjlSzHmd26pS2SQqk9Kt5AT+GKIxzlw+weI/y2039EubV2gJ5AMK190d hm2H0p9EvgAqOwJ6FmXEzX4C36YZktZknnlFJcwtp9uU2jALiqFsa6Lq4pcF0dLK rS89NP7iIOa59+HKMkXe+Vv/Lr8J2lNCFn/d1oDeQvIhfKTWr0T/CoxU+L5JL1ww 5a9At5qSAS2mfSoG4uREBiourpPE05KpaWEedLDiNG5Vzd1VMXYPeL+Wih0R49QG ovgCF5XNT+JwLEmQcQplp0+gdkeyoX4j8guEZIQQ9b2MV5zWPR+1Sk+a4Uyx5l4/ vobhDrq+osqiXyEeKX8ked4Vp7RxjttzFdeASf1XIkhKiFYPD1xlTr1qei/tUrpt gAt4pW32Je6URlbc+HSDQwhfSxBLnwASeefyqmU8z06Ieep9KhrAoIx5CZ1EGZOM 5XOg6qPGUX+Z3KFVrIl2iXExjRxvcj+OW+cFf5e7dlhgarvY9euUpVX4eCgTHRib WOBMK3VgvW//DYcLOQNsSzcN9B6mjBXy7AT0pDQ2yM68g2lG+2CT+KfNyuMJSk+r KLGd8pgftNxdaKsFDemQdXrbgtue7t6D13MulLVhyONiqdO2BB0= =uq7B -----END PGP SIGNATURE----- --a8HV9FOIU3JiWApk--