Avoid retaining conflict-related data when no tables are subscribed

From: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>
Subject: Avoid retaining conflict-related data when no tables are subscribed
Date: 2025-08-28 02:23:56
Message-ID: OS9PR01MB16913DACB64E5721872AA5C02943BA@OS9PR01MB16913.jpnprd01.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Best Regards,
Hou zj

Attachment Content-Type Size
v1-0001-Avoid-retaining-conflict-related-data-when-no-tab.patch application/octet-stream 5.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2025-08-28 02:27:58 Re: Mark ItemPointer parameters as const in tuple/table lock functions
Previous Message Chao Li 2025-08-28 01:53:15 Re: Identifying function-lookup failures due to argument name mismatches