Re: Memory leak in WAL sender with pgoutput (v10~)
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>, Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-12-03T13:45:22Z
Lists: pgsql-hackers
On 2024-Dec-03, Amit Kapila wrote: > On Tue, Dec 3, 2024 at 4:03 PM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote: > > > > If you don't like the idea of a static memcxt in the one block where > > it's needed, I propose to store a new memcxt in PGOutputData, to be used > > exclusively for publications, with a well defined lifetime. > > +1. This sounds like a way to proceed at least for HEAD. For > back-branches, it is less clear whether changing PGOutputData is a > good idea. Can such a change in back branches break any existing > non-core code (extensions)? 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. 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. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
Commits
-
Fix memory leak in pgoutput with relation attribute map
- a786cf04df76 13.19 landed
- c53d90bb47ae 14.16 landed
- da8bd5d424e0 15.11 landed
- e3a27fd06d06 16.7 landed
- 836435424ba8 17.3 landed
- c9b3d4909bbf 18.0 landed
-
Fix memory leak in pgoutput with publication list cache
- ba230ce40faa 13.19 landed
- cfd6cbcf9be0 14.16 landed
- 6c9b3975407d 15.11 landed
- 4d45e7490c41 16.7 landed
- bbe68c13abe0 17.3 landed
- f0c569d71515 18.0 landed
-
Allow specifying row filters for logical replication of tables.
- 52e4f0cd472d 15.0 cited