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 1wPnlt-0012Tl-39 for pgsql-hackers@arkaria.postgresql.org; Wed, 20 May 2026 20:44:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wPnlp-008W2D-2E for pgsql-hackers@arkaria.postgresql.org; Wed, 20 May 2026 20:44:02 +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.96) (envelope-from ) id 1wPnln-008W21-1O for pgsql-hackers@lists.postgresql.org; Wed, 20 May 2026 20:44:02 +0000 Received: from fhigh-a5-smtp.messagingengine.com ([103.168.172.156]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wPnlk-00000000XWa-3J3E for pgsql-hackers@postgresql.org; Wed, 20 May 2026 20:43:59 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 5D89D1400109; Wed, 20 May 2026 16:43:55 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Wed, 20 May 2026 16:43:55 -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=1779309835; x=1779396235; bh=7WdHh6/X2t fxzP3cvfZrlE9Wbxfmt1pLJNpcdxrBjhE=; b=G/ymf99PtuWBDODi1AqRpJPLZi zMBpXV4Fkhw3AY9rMQxGoi9yEPj5ECXvW6vW7sx+m7y2nUvKsoV9dmmnB0L9kM9l C5aAaZEn0Nj7xYsvQCffTzKqtVVauUCD41bq/S0D+kEx634MYN39pFsbEWPNE0i6 yrYh2H6vMtRyE8fSBxesKT24NIyDoUXAv+Kyvy81pMaRphs/zGuZWkw9ry33EsDN KdZ2Q7V6mt4QG0gdColmf6HG/o6DMA7zLNOI6Rnuf8kWoFy2Ik1245bEi/p464N4 2VAxfwx+6pw6esFp819muv+uSWd7b1bSxWxJ7JjDQqEIGhtCL6ovcUNSuwlA== 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= 1779309835; x=1779396235; bh=7WdHh6/X2tfxzP3cvfZrlE9Wbxfmt1pLJNp cdxrBjhE=; b=szd3ZXy1na3FCBNZK4VQmSMAvP9Fupi/A5fdyrdY1LHb2eIu5tt HGituM/vBH5LGwv+As1b8tkniXItsU9uYGTUjmpploiTly+4gRDVlV1tpgOKHVRF 2vUUm4mbBJbKtlgxCmRqDfkaoW7lhnn3oHZWUPzWgZgGMqwdK4//mroyPDRcKaUZ aDj0b574qIQGszlge1Pkg9wykIKqevDEBmbXq/Ph8qr5Pp+0DajjIKzHreilD7Iu PL+22DvVjMk7R+63WjQ9L4vFgc96dUPdrarLzuxzQqgyTYHHTmtg/EuN1CQtMXdJ zXwI4ZIkfBMOH3O9+Bb8jK3fzQAyJNgEODg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddugeehiedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdlfeehmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepgeffjeevgfevuddvjedtvddtieej heduueelvddufedtgfefjedvkeevkeeivddvnecuffhomhgrihhnpehpohhsthhgrhgvsh hqlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiipdhnsggprhgtphhtthhopeegpd hmohguvgepshhmthhpohhuthdprhgtphhtthhopehlihdrvghvrghnrdgthhgrohesghhm rghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrh gvshhqlhdrohhrghdprhgtphhtthhopehmihgthhgrvghlrdhprghquhhivghrsehgmhgr ihhlrdgtohhmpdhrtghpthhtohepgihunhgvnhhgiihhohhusehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 20 May 2026 16:43:54 -0400 (EDT) Date: Thu, 21 May 2026 05:43:52 +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> <75CDE990-29D5-4D5C-BFE1-3840F19C0163@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="MGSW4+x6M619+Xlc" Content-Disposition: inline In-Reply-To: <75CDE990-29D5-4D5C-BFE1-3840F19C0163@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --MGSW4+x6M619+Xlc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 20, 2026 at 03:53:38PM +0800, Chao Li wrote: > With v2, slot_name, sender_host, sender_port, and conninfo are > already left NULL while the receiver is in CONNECTING state. I feel > we don't have to show the timestamp fields either. Since the columns > are named last_msg_send_time and last_msg_receipt_time, users may > naturally interpret them as the last time a message was sent to or > received from > the primary. If we show the standby server start time in those > columns, I am afraid that could be confusing. >=20 > But I think it might be useful to show the *_lsn and *_tli values in > CONNECTING state if they are available. The original reason why ready_to_display has been introduced is this one, where we wanted to have a strict control over the connection information across multiple calls of pg_stat_get_wal_receiver(): https://www.postgresql.org/message-id/CAB7nPqQNbHQ7F7wDD_2qvGA_FUW-Leds9HQN= M6kJnto7RFNhUg@mail.gmail.com With v2, ready_to_display is still able to do the job it is defined for. This does not need to apply on the time fields, so IMO showing them to the values they are initialized is not a big deal, and they can actually be useful to know even in the early stage of connection as they reveal the state of the code. =20 Note also that the time values could still show up based on their initial values at the early connection stage, even after completing walrcv_connect() and after ready_to_display is switched to true, so it's not like these values are that confusing: we just expose them a bit more at an earlier stage of the connection attempt process. As a whole v2 is fine, and addresses your issue. -- Michael --MGSW4+x6M619+Xlc Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmoOHQgACgkQnvQgOdby QH39/BAAgTBpvb5hMehRpFtFrjfuVy+4LBlfBwKj5asuQTVCpuLHrUfX5/lA0KO6 /9DMSbvEV87MP65A/JupINj3rMhMhg9nDTDP6AJfgAnDnaDzRnEAX4MA/k6fea26 Ws+Yoi0s8VLUMa2k8tdtzMILfsSbfiitNf9Jb8uFknQM6tQ+z0E4AIGHaNk29624 AjOFunY6ZNhVSCNbEpko4+kyYIbby0XPPMYu+E3F7jd41h5Mni0RNPsU8mL/sWdr VMKDKF9JJWelxkW1xqDNp2ynw2cGQox5OzFpVYxqyNJkpvgzAneY6N1qXviLoDWU hYm+8RTFjaw7zwmlN2o5PxadARyKdWY46NVmBKR5JzPzqp49QSfDmhDM5M21vAOx Kbj5Qr81JCpYTYtMr9+DFMBku/ZdrWu5tE2vj9FKIrPCG0eioAHOfDBMJZzTX43+ u3GSYbXoELl0QLGmrcF0LWZ4pUKD5CFOBMM/bwkOotqVEIiQFdWdTwyyeKDSzNpy s9hW5zfBVzmBKeKhRNeZkxNpgMgQqorHo/bzwybe+VO64Jdw3/9ZwcX7x/LeDHo0 SBMOsh0bzEEk6RR6s/5WfOzw76TxVl+R8S3dspuZDjU68QkFwGo/+6Ax1cPl1a4s gTikeGvF0xFWAPVoEHB0mRncCfRAMY2mM4BNP2SuB0HrlyZbGGg= =WOyz -----END PGP SIGNATURE----- --MGSW4+x6M619+Xlc--