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 1vmon7-00GbAT-0M for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Feb 2026 07:56:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vmon4-00Cskd-0l for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Feb 2026 07:56:11 +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 1vmon3-00CskQ-2c for pgsql-hackers@lists.postgresql.org; Mon, 02 Feb 2026 07:56:10 +0000 Received: from fout-b4-smtp.messagingengine.com ([202.12.124.147]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vmon3-000000009mb-0KNS for pgsql-hackers@postgresql.org; Mon, 02 Feb 2026 07:56:09 +0000 Received: from phl-compute-08.internal (phl-compute-08.internal [10.202.2.48]) by mailfout.stl.internal (Postfix) with ESMTP id DD8D41D000B2; Mon, 2 Feb 2026 02:56:07 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Mon, 02 Feb 2026 02:56:08 -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=fm3; t=1770018967; x=1770105367; bh=kH0EN0VK8s GeSd30izknEMkzvW7Wnltehlr/efjz9Zs=; b=ims5/abyylG1Qs7moI5AI5yzNL VXv+gVxYOYheXEKQzoCHk1fxleHM7f4oeedK3FKOE9uCJA/0W1VxqY9fEGs6872w XCldewqclyVmMZCa5D+Rjonl8LWKKDpOAHsEL0LbFvK0WiV+Y/9baJBU2hsUfGY5 Nm5hFIcGzZ9ZwKa4p9zf56l0w2lpPHndPZH+ByQs/XiVsVXEG3qRWni5F2pH/ssE C9s8z8z+5F6wFtOR7QU6w3WKvsYMlHhR0oX0c3oQUEaLCaplltyEcbhp9zORZRzT uxncxdfEBe+TCSXkzvTlwIv1/FcxYzyA7GpEziN10kF8kmB6eg6Jk7L4iLUw== 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= 1770018967; x=1770105367; bh=kH0EN0VK8sGeSd30izknEMkzvW7Wnltehlr /efjz9Zs=; b=ktT7uRVv+gWz1eifvoj7w4wG9ojSQtPP8oJRA44kh2pRvFJpt3k Doe5b82e9TNOCU8hZeIkNeJp1fBPL/mAcLiLIQdxUwlP4fcANZaq/1dOg+28Z7BY 5HAII52Co9Spbjzh/sNnVF6gBZm89VqXNdSVqKKAbIe2gPwrV1F04ljcTJnIHV6U CH2+fez3ViBQd9huo5/g0+R7bs8d3lAQ4chMtVtbr6kZ24YFz8XzeR5HDEytSgj5 y9NBHiZfxZ4b5Y2OutOq9LqwypzZP5jafIgw7eyisxUib3INBGQTRG4/B+9j7JkY PSoKK/wH1GDDOCrBMUXJzoocu5klhCoQdCg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddujeejuddtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeggeeg fffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidp nhgspghrtghpthhtohepudehpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegrrd hsihhlihhtshhkihihsehpohhsthhgrhgvshhprhhordhruhdprhgtphhtthhopehpghhs qhhlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehvrd gurghvhiguohhvsehpohhsthhgrhgvshhprhhordhruhdprhgtphhtthhopehkuhhrohgu rgdrhhgrhigrthhosehfuhhjihhtshhurdgtohhmpdhrtghpthhtohepohhsuhhmihdrth grkhgrmhhitghhihesfhhujhhithhsuhdrtghomhdprhgtphhtthhopehsrgifrggurgdr mhhshhhksehgmhgrihhlrdgtohhmpdhrtghpthhtohepphgvthgvrhdrvghishgvnhhtrh gruhhtsegvnhhtvghrphhrihhsvggusgdrtghomhdprhgtphhtthhopeguihhlihhpsggr lhgruhhtsehgmhgrihhlrdgtohhmpdhrtghpthhtoheprghnughrvghssegrnhgrrhgrii gvlhdruggv X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 2 Feb 2026 02:56:03 -0500 (EST) Date: Mon, 2 Feb 2026 16:55:59 +0900 From: Michael Paquier To: Andrey Silitskiy Cc: "pgsql-hackers@postgresql.org" , Vitaly Davydov , "Hayato Kuroda (Fujitsu)" , "Takamichi Osumi (Fujitsu)" , "sawada.mshk@gmail.com" , "peter.eisentraut@enterprisedb.com" , "dilipbalaut@gmail.com" , "andres@anarazel.de" , "amit.kapila16@gmail.com" , Kyotaro Horiguchi , Peter Smith , Greg Sabino Mullane , Alexander Korotkov , Fujii Masao Subject: Re: Exit walsender before confirming remote flush in logical replication Message-ID: References: <3d024a19-1256-4177-942a-d7173dacba74@postgrespro.ru> <045cf632-1354-4d42-a8ea-cc02eaa80d68@postgrespro.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="xPnaRxa+SAJ7QQqJ" Content-Disposition: inline In-Reply-To: <045cf632-1354-4d42-a8ea-cc02eaa80d68@postgrespro.ru> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --xPnaRxa+SAJ7QQqJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 02, 2026 at 02:52:36AM +0700, Andrey Silitskiy wrote: > +/* > + * Shutdown walsender in immediate mode. > + */ > +static void > +WalSndDoneImmediate() > +{ > + QueryCompletion qc; > + > + /* Try to inform receiver that XLOG streaming is done */ > + SetQueryCompletion(&qc, CMDTAG_COPY, 0); > + EndCommand(&qc, DestRemote, false); Couldn't that be potentially dangerous, particularly if wal_sender_shutdown_mode is set to immediate, meaning that it applies to all the WAL senders? The WAL receiver side could be on a backend with an older backend version than the WAL sender where this new GUC exists. Hence, a completion could be understood incorrectly by a WAL receiver depending on how the receiving side is coded? Assuming this is merged into v19 in this shape, a receiver connecting to a newer server would get a new bevahior compared to older versions, without the receiver being aware of that. I suspect that this option, as designed, is potentially a footgun that=20 could surprise many users, especially as it is super aggressive in shutting down everything on sight, unconditionally. -- Michael --xPnaRxa+SAJ7QQqJ Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmmAWI8ACgkQnvQgOdby QH0pCw//QwrlRwn7lZ4mTVgtzGjXrYqCT1SypKlvkiN5RPI/m2kbketoEHaXXvIg InYgm4rSLFPF1XK5tq3dvkOdEy/qfsjNYDOdGKtbOeiCm+6Zo48orch7GSqOkuJO aeaq8XzvJMkJlh/5M9THZ1ZGNeBpO0mLvOzGc4MkFJ0kvI34Q6wNOICDkfSg19ee jRnhKviwncLC2cA4wSI2X1WTG6W5Hy935gYvKwnz0pbaTzJ2doLw3p0fjW4FUnep K+KfRXFe7ycCyPN93I9KRUdQxB6rxn8FY83xgvH0zqvjR1GDcFVTMxM0ekMuvRDp vkctOXA5XDnrqM8oDeQOHbXHcf4RPkQHR7w4vbrKFE+Ec69u7ENTzUUOv43AwSd+ jLhGGlN3hOoQ5LYH/Zb4wyFYpTsUmIQH74qLv/Lg32ozA6BsaGCkS2PLu6BqRDBi MSwptTe8ZcfqNvlBQeVo2qmA163cG3UO02Pn870Q0+FC7Wae5QDi7TF/P5YoHIDQ 4gP8VCetjhSNCphbtifya3sW7YjjdGj+/g5TuIC/bf1PkV3bSiIhMkaP1lCqDb1c gQY3k8UfXQyG3UsaXgLuPTMv5wzecldepUcujRN+aUPSIXiMwsvbInp97zXZMbOv SWa9GB7InTUrVFtkTTGu11Lt7Qkmt4qJ7Dp1BFoyYxM7H5LXycs= =jOcg -----END PGP SIGNATURE----- --xPnaRxa+SAJ7QQqJ--