Re: Memory leak in WAL sender with pgoutput (v10~)
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Michael Paquier <michael@paquier.xyz>, Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-12-03T04:20:42Z
Lists: pgsql-hackers
On Tue, Dec 3, 2024 at 2:12 AM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote: > > On 2024-Dec-02, Amit Kapila wrote: > > > 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. > But that suits the current design more. We allocate PGOutputData and other contexts in that structure in a "Logical decoding context". A few of its members (publications, publication_names) residing in totally unrelated contexts sounds odd. In the first place, we don't need to allocate publications under CacheMemoryContext, they should be allocated in PGOutputData->cachectx. However, because we need to free those entirely at one-shot during invalidation processing, we could use a new context as a child context of PGOutputData->cachectx. Unless I am missing something, the current memory context usage appears more like a coding convenience than a thoughtful design decision. -- With Regards, Amit Kapila.
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