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.96) (envelope-from ) id 1wPYGa-000pN1-02 for pgsql-hackers@arkaria.postgresql.org; Wed, 20 May 2026 04:10:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wPYGX-006AJU-38 for pgsql-hackers@arkaria.postgresql.org; Wed, 20 May 2026 04:10:42 +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.96) (envelope-from ) id 1wPYGX-006AJJ-2F for pgsql-hackers@lists.postgresql.org; Wed, 20 May 2026 04:10:42 +0000 Received: from fhigh-a2-smtp.messagingengine.com ([103.168.172.153]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wPYGW-00000000UJO-2LDO for pgsql-hackers@postgresql.org; Wed, 20 May 2026 04:10:42 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 75A0A14000DE; Wed, 20 May 2026 00:10:38 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Wed, 20 May 2026 00:10:38 -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=fm3; t=1779250238; x=1779336638; bh=/1+31Xmx6W r3MJVHzOnM0TVWpoPxAvsk9EJoUe0YkVM=; b=MF+kgNSH1KRkcUKeMHyKuSFiK+ G5lm1zGIbW/oqUux8AE/MjqGI2wzyckpbcg5ChBVmqpIYq4+8Fq27Ei+QGg7s6Wh s8QPP05ZLF+MZB2r7zMEyqLWLsRIm/4t+hSdTUOHRCO9K3R8MJ/0FkbF5EXg63IG 6Ne427D8R7G2sA5ENVYlRd/KNZcI4zBu14Cg3NPnrwTi6RdZz0eZfMIgTQ+OaEkH oHDJef8ZU54sk3/2afjzBvhLnUBu+nJFtWI/Iv4Cqv8fKthqurcpm9VWUhY9i3jZ 5Z0V+ojBC1nB1VDuJUhsLdZTY6U0vf4dHLcb/hdXXKO44gHPom2QhXx5ayxQ== 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=fm3; t= 1779250238; x=1779336638; bh=/1+31Xmx6Wr3MJVHzOnM0TVWpoPxAvsk9EJ oUe0YkVM=; b=g/BTWE0tdQr+oMypXAL0N18nVfOmR01YME63E+Zlto6W2oRY9La CM9Nni+z63yQ4ssmXBhPWnPWgVcF0TRcYdifKigo6DN7cSWX+mXdcD+wEzFQdM+c v6IK3R99jLvHXzY5rRBbRqxJJpZpdYK1l1KkN7pwRbn1vx3icbwqBnWEk5YDNFjd 2cmUyAcEcdYu8JbsrKXLQox5E29V7s0gbkSCd9CsSUvz+bQDY4A+NCQGTuL7EV/e ylH2tkFd0ARSjXE8c0npw+k81s51uF0dagWwcIa1/rBPxTpyvF1Um+B4cKDB5/kt vLOVDSq2xeqpmR1RTRuD1RMgPgIONNE/ORw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddugeefieefucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeggeeg fffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidp nhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheplhhird gvvhgrnhdrtghhrghosehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgr tghkvghrshesphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepmhhitghhrggvlh drphgrqhhuihgvrhesghhmrghilhdrtghomhdprhgtphhtthhopeiguhhnvghnghiihhho uhesghhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 20 May 2026 00:10:37 -0400 (EDT) Date: Wed, 20 May 2026 13:10:33 +0900 From: Michael Paquier To: Chao Li Cc: PostgreSQL-development , Michael Paquier , Xuneng Zhou Subject: Re: Fix pg_stat_wal_receiver to show CONNECTING status Message-ID: References: <1F153E64-B791-42FA-A60A-64813B20B81E@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="QFGWoSd0t18WFHVq" Content-Disposition: inline In-Reply-To: <1F153E64-B791-42FA-A60A-64813B20B81E@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --QFGWoSd0t18WFHVq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 20, 2026 at 09:47:40AM +0800, Chao Li wrote: > I just read v2, and it is actually the first solution I tried. The > reason I gave up on that approach and switched to the implementation > in v1 is that it may wrongly report last_msg_send_time, > last_msg_receipt_time, and latest_end_time. As of the code, we have the following at the top of WalReceiverMain() before the first connection attempt: /* Initialise to a sanish value */ now =3D GetCurrentTimestamp(); walrcv->lastMsgSendTime =3D walrcv->lastMsgReceiptTime =3D walrcv->latestWalEndTime =3D now; And the state of v2 is actually fine, because we finish by reporting in the SQL calls values that represent the state the WAL receiver is=20 initialized at based on what the code does. It would be IMO an issue to hide this information, as they can offer hits about the moment when we've begun a connection. -- Michael --QFGWoSd0t18WFHVq Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmoNNDkACgkQnvQgOdby QH2xsg//QcOgqQhTNJMnZoOWR8A9gtzDnH8p1x1YD3Z6H9CAfA+H2fXr0ieKrssi eOoJIU6F5hqGQJlOKouPoX1nQ+//eUjbJpj1LXZNVTDErylzESYAmYdl9phCYusD iKSkDZ4ADB3KuU01eg52+TtJWUn/mqHE/HOeSmx2UGviRLQPciPZXpj9I8oFjpYC xLFfXGs14pUoHPLk+JeFV+pr1zQ9Fy8YvricWpEO5rBkASdIvCOpaIaE4qfCHq/M YAEhmcnp61asspFDjIHxCe4XtQUpRdZ0V4RUHB0We7C2IAaWU/b++XRdmL+uDqXM jVes/Y0ruSkhzQcntxYuVLh+0LY8nzJRT5hnEGC1KqR86FI9to3rR86w8WPffKXb dxW39+JZPzRzsUGx+N/V5NI0uy7m7pC/1EUg0d+LWCR58h0CaV87kfbxQCET53kw wyPTEJ6j7lczSguyYpSOwm881cuWX28pvArnGH8AOeg30xWGBQ+CEDwFTRTErKo7 WKBNGioW6XonCBKqW9W/jzmcSLN41c7tNWTN8x7bbLwQGlxD/g2NbwYcq1MnhYli a3jQTYR6rpbPtRDc+pNf493ru4pKGrery6zWysav4k4tvnPLQIW797+i4ZqC/hPk XaYXPrprr5/24DyspttHZVYdfiKPLN+FyZwaZX95RB2pkqU/tRg= =PM8V -----END PGP SIGNATURE----- --QFGWoSd0t18WFHVq--