RE: Per-table resync for logical replication subscriptions

From: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: 'Cagri Biroglu' <cagri(dot)biroglu(at)adyen(dot)com>
Cc: "smithpb2250(at)gmail(dot)com" <smithpb2250(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Subject: RE: Per-table resync for logical replication subscriptions
Date: 2026-08-21 02:54:35
Message-ID: OS9PR01MB1214999564BA9BDCE6015BBB4F5A32@OS9PR01MB12149.jpnprd01.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear Cagri,

Hi, thanks for updating the patch. Sorry I could not reply to your latest post,
because it was blocked by the company's rule.

Few comments:
01.
According to ExecuteTruncate(), we did some additional check like
truncate_check_rel() and truncate_check_perms(). Is it needed here? If not we can
add code comment here. At least, InvokeObjectTruncateHoo() seems needed.

02. Question:
This command drops replication origins and remote slots, which cannot be rolled back.
So what should users do the command fails?

03.
Also, such operations should be done after the transctional ones (ExecuteTruncateGuts).

04.
I found that ATTACH PARTITION/DETACH PARTITION CONCURRENTLY command acquires the
ShareUpdateExclusive Lock for the root table. This can cause that tables are
missed to be truncated, or detached tables can be truncated.
One primitive idea for fixing is to check whether the schema structure is modified
after acquiring the AccesExclusive lock, but there may be better approaches.

Best regards,
Hayato Kuroda
FUJITSU LIMITED

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2026-08-21 02:55:23 Re: Reduce memory overheads for storing a Memoize tuple
Previous Message Tatsuo Ishii 2026-08-21 02:40:02 Re: Row pattern recognition