Re: Table refer leak in logical replication

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Amit Langote <amitlangote09(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>, "tanghy(dot)fnst(at)fujitsu(dot)com" <tanghy(dot)fnst(at)fujitsu(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "shiy(dot)fnst(at)fujitsu(dot)com" <shiy(dot)fnst(at)fujitsu(dot)com>
Subject: Re: Table refer leak in logical replication
Date: 2021-04-19 11:57:02
Message-ID: CAA4eK1KiMe3=b3cS_Mn2Lnbpo1QRDmbJZap6saz+85zpTv4UtA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Apr 19, 2021 at 5:20 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Mon, Apr 19, 2021 at 08:09:05PM +0900, Amit Langote wrote:
> > On Mon, Apr 19, 2021 at 7:00 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> >> It seems like the memory will be freed after we apply the truncate
> >> because we reset the ApplyMessageContext after applying each message,
> >> so maybe we don't need to bother about it.
> >
> > Yes, ApplyMessageContext seems short-lived enough for this not to
> > matter. In the case of ExecuteTruncateGuts(), it's PortalContext, but
> > we don't seem to bother about leaking into that one too.
>
> Sorry for the dump question because I have not studied this part of
> the code in any extensive way, but how many changes at maximum can be
> applied within a single ApplyMessageContext?
>

It is one change for Insert/UpdateDelete. See apply_dispatch() for
different change messages.

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-04-19 12:02:21 Re: [CLOBBER_CACHE]Server crashed with segfault 11 while executing clusterdb
Previous Message Justin Pryzby 2021-04-19 11:55:04 Re: [CLOBBER_CACHE]Server crashed with segfault 11 while executing clusterdb