On Fri, May 15, 2026 at 11:02 AM Xuneng Zhou <[email protected]> wrote:
>
> pg_sync_replication_slots() now retries inside a single SQL function
> call.  Unlike the slotsync worker, it does not get a transaction boundary
> between retry cycles, so allocations made while fetching and synchronizing
> remote slots can accumulate until the function returns.
>
> The existing list_free_deep(remote_slots) is not enough to bound this.
> It frees the List cells and the RemoteSlot structs stored as list
> elements, but it does not recursively free allocations owned by those
> structs, such as the copied slot name, plugin name, and database name.
>

Right.

> It also does not release unrelated per-cycle allocations made while
> fetching and processing the remote slots.
>

BTW, did you notice via test or otherwise, what and how much other
unrelated memory is being allocated during each sync cycle if we
manually free the allocations you observed? This is mainly to learn
the impact of not doing all these allocations in some short-duration
memory context.

-- 
With Regards,
Amit Kapila.


Reply via email to