Re: Bound memory usage during manual slot sync retries - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Bound memory usage during manual slot sync retries
Date
Msg-id CAA4eK1+mGigBhtZG3ZNZim0EDDcrEjauCTNp7S1166xesSRnFQ@mail.gmail.com
Whole thread
In response to Re: Bound memory usage during manual slot sync retries  (Xuneng Zhou <xunengzhou@gmail.com>)
Responses Re: Bound memory usage during manual slot sync retries
List pgsql-hackers
On Tue, May 26, 2026 at 1:01 PM Xuneng Zhou <xunengzhou@gmail.com> wrote:
>
>
>> On Mon, May 25, 2026 at 7:03 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
>> >
>> > Okay, then let's go with a per-retry memory context approach.
>> >
>> > @@ -579,6 +579,8 @@ drop_local_obsolete_slots(List *remote_slot_list)
>> >      local_slot->data.database));
>> >   }
>> >   }
>> > +
>> > + list_free(local_slots);
>> >  }
>> >
>> > Why do we need this retail pfree if the caller is using memory context?
>> >
>>
>> I see that the latest patch in email [1] has already addressed this
>> point. So, I'll push the v2 version.
>>
>> [1] - https://www.postgresql.org/message-id/CABPTF7WB4Z62sPoZkhSygOCAo3OiTDLpMELxZDuwCb3HYgM_pQ%40mail.gmail.com
>
>
> Thanks. My original reasoning for adding the pfree here was to act as a safety guard in case other future callers
mightnot manage the memory properly. But Zhijie pointed out that this double-free pattern is not favored in previous
communitydiscussions. I'll post the  worst-case test and its results later. 
>

Pushed.

--
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Richard Guo
Date:
Subject: Re: Fix HAVING-to-WHERE pushdown with mismatched operator families
Next
From: Michael Paquier
Date:
Subject: Re: PostgreSQL and OpenSSL 4.0.0