Re: Avoid retaining conflict-related data when no tables are subscribed - Mailing list pgsql-hackers

From shveta malik
Subject Re: Avoid retaining conflict-related data when no tables are subscribed
Date
Msg-id CAJpy0uBWd_mgT+QFwL4xD1HQJ26+sA17gp+TZDh4aefKZv2nVw@mail.gmail.com
Whole thread Raw
In response to Avoid retaining conflict-related data when no tables are subscribed  ("Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>)
List pgsql-hackers
On Thu, Aug 28, 2025 at 7:54 AM Zhijie Hou (Fujitsu)
<houzj.fnst@fujitsu.com> wrote:
>
> Hi,
>
> My colleague Nisha reported an issue to me off-list: dead tuples can't
> be removed when retain_dead_tuples is enabled for a subscription with no tables.
>
> This appears to stem from the inability to advance the non-removable transaction
> ID when AllTablesyncsReady() returns false. Since this function returns false
> when no tables are present, which leads to unnecessary data retention until a
> table is added to the subscription.
>
> Since dead tuples don't need to be retained when no tables are subscribed, here
> is a patch to fix it, modifying AllTablesyncsReady() to allows no tables to be
> treated as a ready state when explicitly requested.
>

The patch LGTM. Verified it, fixes the issue.

thanks
Shveta



pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: Report reorder buffer size
Next
From: Dilip Kumar
Date:
Subject: Re: Avoid retaining conflict-related data when no tables are subscribed