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 1tIbaV-00FLSU-56 for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Dec 2024 22:41:47 +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 1tIbaS-00DPFA-8E for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Dec 2024 22:41:45 +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 1tIbaQ-00DPCf-R8 for pgsql-hackers@lists.postgresql.org; Tue, 03 Dec 2024 22:41:45 +0000 Received: from fout-b1-smtp.messagingengine.com ([202.12.124.144]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIbaN-000u5u-Pa for pgsql-hackers@lists.postgresql.org; Tue, 03 Dec 2024 22:41:43 +0000 Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id B6235114010C; Tue, 3 Dec 2024 17:41:37 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Tue, 03 Dec 2024 17:41:37 -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=1733265697; x=1733352097; bh=QWaqwuQdjU wc6izkZd0OqZRZAtvPbQFbg00X4dJjO2o=; b=TkG1+++xD1PQNT1ISMtNpc4JtC JUoSGbsnBtlhRZ1ThTT4ZqluuzRvccB5DJRYIDGncRY5jS79X013+77eaoZoI7vC 32UXqqxRoYZuSSeqTkQmzFMplaPvuBBhCUXwZ97Hh2VVboU60HkzaJdVOIi4xwJU fSeJGIou7GfoLPsLyT54lPLqR1+03BzmQ44HuBZ9NqROnHfIVTklLBp3/BiGxCKb bMZLDHfpV8KqToaPwBy8hEk0t5a7AY9YNBonle3d2CkfxwS+yeZm3htrZifOFD4S ys+M0HbUdaEx/7IRxt2DAepjtpA/wb0xCIMlczaWFvg++Qt64pBlPhDvhTgA== 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= 1733265697; x=1733352097; bh=QWaqwuQdjUwc6izkZd0OqZRZAtvPbQFbg00 X4dJjO2o=; b=anD7ASjYFwYX1xtcqYJqrNZxoMMdYewU7WubbCu46OEdcEgk9wM /sfwEZgkJs5mzpKdlk2ntUwuvk65Wo3Gfr1KKmx7cP3f75xidcwlAC9YPC2my1CU RCPUreMQ3WmsfpkhhbTGN5Nr8uDbntesLtJqLpxM0xjr88oxPXHKoFcIdVuPT3Kg h+7KdLQIfqoN6RGIWedvT64J6WX5rSHcl1hnr6S65/Ojnjc5qj7Qbz08e/Cot/j7 SNou1A9n8Kv3hzt8/ZGw4pvKuwWuLpRUiY8irFGQmzoYm1Fgh8mIqZdWNVABMN/k XbkWFlUgvcjk2WoHqeosQTFHoyoK2hWsR0A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrieefgddufeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnegfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhf gggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruc eomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteel ieefudffhffhtdetleeggeegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhes phgrqhhuihgvrhdrgiihiidpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouh htpdhrtghpthhtoheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrghdprhgt phhtthhopegrmhhithdrkhgrphhilhgrudeisehgmhgrihhlrdgtohhmpdhrtghpthhtoh epphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 3 Dec 2024 17:41:35 -0500 (EST) Date: Wed, 4 Dec 2024 07:41:19 +0900 From: Michael Paquier To: Alvaro Herrera Cc: Amit Kapila , Postgres hackers Subject: Re: Memory leak in WAL sender with pgoutput (v10~) Message-ID: References: <202412031345.jxrlhwe2a2qa@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="BIHDY/at/KSTX8tk" Content-Disposition: inline In-Reply-To: <202412031345.jxrlhwe2a2qa@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --BIHDY/at/KSTX8tk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 03, 2024 at 02:45:22PM +0100, Alvaro Herrera wrote: > We can put the new member at the end of the struct, it shouldn't damage > anything even if they're using this struct -- which I find pretty > unlikely. The only way that could break anything is if somebody is > allocating/using arrays of it, which sounds even more unlikely. Yes, that sounds unlikely. =20 > If we don't want to accept that risk (for which I see no argument, but > happy to be proven wrong), I would suggest to use the foreach-pfree > pattern Michael first proposed for the backbranches, and the new memory > context in master. I think this is conducive to better coding overall > as we clean things up in this area. Is it really worth betting on nobody doing something that does a sizeof(PGOutputData) for the stable branches? People like doing fancy things, and we would not hear about such problems except if we push the button making it a possibility because compiled code suddenly breaks after a minor release update of the core engine. -- Michael --BIHDY/at/KSTX8tk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmdPiQ8ACgkQnvQgOdby QH2rFBAAhCDOYMr3ThA3vjve/KQpuPYGOpG6uCz6HI/yqH0vcQBa7CTHCdCBZPob 5e6Kfyu3RUruvmwgpBt5VVde0yKp546UoG4i9WdsIBjQA9KfpPQFsWUa8Jr/S4wa 3iSgmXdbi5k4Ec6lYH/clsIUSnsED/hyAaggb7ebI3k+4g8w/e+C4I8aygYZy1q6 YGiAu4zXAO4mY3LtR/CIy1JK+rhHL1TCtuiOTWaCn3zbsQaspwCUVLLFi4cH6cQ8 wHShbMtehkQKFBfyC1lvNzKZzEYUaAz1mfBaplHbeU7Y5RUQoq6lDnPnwv6wN2cT 2zUkEkKRJnUAqpSCIHvDMXR+7RCBM5qWJO2WOJgrM8ZmFFJa5DcIKl7h8BMgWICm 9bFCa/O/FORMA0Ay66eez/1BySUF4ABqcUwYWYYO/7LURe7f8jlhHTG4mpt2bS0x YMHphWi3fy6DBjnoMTX9Of0wTQCOoC6d4g+PK/4s9gqdLp3YXMEd2xTf514B5HoT zOhP4tQqyzDxFFkacyTRR8lGpD6oRbj260kPpHWa5I8yxqa1tB/nm1EwuhSEmteK WMMeen8LeuRq8lvNe1x4bqK2IZgeIWBcpxX+hCYOG/SQVL8zphHMMB8v+FQPZhnh 131YWTOPNBlNhHnqClgPh6y8DlwItvALFuTSCqT3mmknxrP8uNU= =MVp8 -----END PGP SIGNATURE----- --BIHDY/at/KSTX8tk--