Re: Proposal: Conflict log history table for Logical Replication

From: Zhijie Hou <houzhijie22(at)gmail(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, saurabh singh <saurabh(dot)singh214(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Proposal: Conflict log history table for Logical Replication
Date: 2026-10-15 10:01:03
Message-ID: CAFvd2n_io_EdNwvshcSM9-oUZny1spUF+we1SyMM=w-OYpcH3w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Tue, Oct 13, 2026 at 6:04 PM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
>
> I merged v80-0001 and v80-0002 and adjusted the commit message and
> test accordingly; I also included Amit's and Hou-san's code
> refactoring. Rebased Nisha's V80_2-0003 on top of that as 0002, also
> merged Shveta's datestyle fix with some modification into the 0002

Thanks for updating the patches.

While reviewing the follow-up patch to error out the worker when it fails to
acquire the CLT lock, I noticed that all the checks in the DDL and the apply
worker are done without checking whether the two_phase option is enabled. Since
the issue only exists when the subscription has prepared a transaction, I think
we shall skip these checks when two_phase is disabled.

In addition, the apply worker currently doesn't check whether a prepared
transaction exists before reporting the ERROR, while we do check in the DDL
path. To make it consistent, I think it would be better to check in the apply
worker as well, this can further narrow down the scope of the ERROR. The change
should be straightforward, and I think there won't be noticeable overhead:
we'd only scan prepared transactions when lock acquisition conflicts, in which
case the worker will either restart or wait on the lock anyway, so the scan is
unnoticeable by comparison.

Best Regards,
Zhijie Hou

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2026-10-15 10:06:56 Re: Proposal: Conflict log history table for Logical Replication
Previous Message Nisha Moond 2026-10-15 09:52:11 Re: Proposal: Conflict log history table for Logical Replication