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 1tIDG0-00Cwd5-Ia for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Dec 2024 20:43:00 +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 1tIDFx-003Ds7-DW for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Dec 2024 20:42:58 +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.94.2) (envelope-from ) id 1tIDFw-003Drz-M6 for pgsql-hackers@lists.postgresql.org; Mon, 02 Dec 2024 20:42:58 +0000 Received: from fout-a5-smtp.messagingengine.com ([103.168.172.148]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIDFv-000i6d-A7 for pgsql-hackers@lists.postgresql.org; Mon, 02 Dec 2024 20:42:56 +0000 Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id B5F3A13802C0; Mon, 2 Dec 2024 15:42:54 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Mon, 02 Dec 2024 15:42:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1733172174; x=1733258574; bh=Q LwjXMTrZe/bQnK/zcHNFbJqrW1TrE3SfZmNT8S9YrI=; b=QvOM40mQAOPlbEmtn 0Q/XcFrIrZOcnwoSYKxjMKGe+u0hOr3kyx7hTJr2tKZg2GJNo48UbrUDOUaHCRhj 7zcc9sdOZ7Wyvazfbm4xCP1O8P2Ru4hCPJc+66P9bxXxZi4nR/X82uykAievalMV w0UkFOppWtkUl3UGrlsHmk20qNEfquu+C9GU/otE/5U76r7KCSpBO9T1uxFx+61L 6qqJGC9p1Wg2jTGeTwnVOtsxUeI8tR0dVpWTrNX4s9blNQW7Mr//VTJolh/vmzm9 q/GETJdSyZ9AqnM1Q4KxFy96bDzpOxFqO2aB78or+7Oxgwf0106stgBs4U7q05sM 2fIjQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrheelgddufeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeen ucfhrhhomheptehlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhh drnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffh jeejhffgieeuueekjeekfffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrph hrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgpdhnsggprh gtphhtthhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegrmhhithdrkhgr phhilhgrudeisehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvg hrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepmhhitghh rggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 2 Dec 2024 15:42:53 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1733172172; bh=K0rJdL4HvjJTN7iS/Wt/hHQfCS8mgUdUWkBnFZCSbqg=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=EyQ7AJb5eocjshVmfO7MXP+NTVP4Pm/TJCcGV/bhrQnfT36lv9HzUPiVNwbaenrnD uOY4qoER3q/Abhgh7ZpPbZaVs7BH0AM1sP1TOOUoes6UuGe2AwJLiTuUqSh1uiDXYo SqZNRw45gn0pp4ZTjR4zHX/t8DnflD0Z+V/OSd+PgrYFWN9OBbM+462d12XnZMifr3 wvWVcw2aysd8IE0eqQY+K8fmPh02eHN/0qy58bgoY94rBHI/J76rfld0501yvDjgkC I+/papPJ4j7ZO2S4vq5rhWNu1G5TkVDFKx8GJqSgtDykthRlhcEASGjXfjb/CpJW8D MZA/ByB3UEVwA== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id D8C4295; Mon, 2 Dec 2024 21:42:52 +0100 (CET) Date: Mon, 2 Dec 2024 21:42:52 +0100 From: Alvaro Herrera To: Amit Kapila Cc: Michael Paquier , Postgres hackers Subject: Re: Memory leak in WAL sender with pgoutput (v10~) Message-ID: <202412022042.v4su6maz6h4g@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024-Dec-02, Amit Kapila wrote: > We already have PGOutputData->cachectx which could be used for it. > I think we should be able to reset such a context when we are > revalidating the publications. I don't see that context being reset anywhere, so I have a hard time imagining that this would work without subtle risk of breakage elsewhere. > Even, if we want a new context for some localized handling, we should > add that in PGOutputData rather than a local context as the proposed > patch is doing at the very least for HEAD. I don't necessarily agree, given that this context is not needed anywhere else. > Can't we consider freeing the publication names individually that can > be backpatchable and have no or minimal risk of breaking anything? That was my first thought, but then it occurred to me that such a thing would be totally pointless. > > you call anything that loads a Publication depending on how the caller > > caches its data. So I would still choose for modifying the structure > > on HEAD removing the pstrdup() for the publication name. > > BTW, the subscription structure also used the name in a similar way. > This will make the publication/subscription names handled differently. True (with conninfo, slotname, synccommit, and origin). FWIW it seems FreeSubscription is incomplete, and not only because it fails to free the publication names ... (Why are we storing a string in Subscription->synccommit?) -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Los trabajadores menos efectivos son sistematicamente llevados al lugar donde pueden hacer el menor daño posible: gerencia." (El principio Dilbert)