RE: memory leak in logical WAL sender with pgoutput's cachectx

From: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: 'Xuneng Zhou' <xunengzhou(at)gmail(dot)com>
Cc: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, 赵宇鹏(宇彭) <zhaoyupeng(dot)zyp(at)alibaba-inc(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Subject: RE: memory leak in logical WAL sender with pgoutput's cachectx
Date: 2025-08-21 05:27:03
Message-ID: OSCPR01MB14966E500A290B3279A1C7341F532A@OSCPR01MB14966.jpnprd01.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear Xuneng,

> This may not be ideal. It decrements on every lookup of an existing
> entry, not just when consuming an invalidation, which could make the
> counter go
> negative. Do we need decrementing logic? Not perfect 1:1 tracking
> seems ok in here; though it might make the clean-up a bit more
> aggressive.

Yeah it was not needed. I posted new approach [1] and even this has a possibility
that some of listed entries are revived. At that time they won't be removed
immediately, they can be skipped while cleaning up.

[1]: https://www.postgresql.org/message-id/OSCPR01MB14966E0225BC4AA1BC956E1E3F532A%40OSCPR01MB14966.jpnprd01.prod.outlook.com

Best regards,
Hayato Kuroda
FUJITSU LIMITED

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-08-21 05:28:04 Re: Redesigning postmaster death handling
Previous Message Hayato Kuroda (Fujitsu) 2025-08-21 05:23:07 RE: memory leak in logical WAL sender with pgoutput's cachectx