Re: Proposal: Conflict log history table for Logical Replication

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Zhijie Hou <houzhijie22(at)gmail(dot)com>
Cc: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, shveta malik <shveta(dot)malik(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-08 23:45:31
Message-ID: CAA4eK1L-yBio2zbSVsKQ9LCy8orszXviqORHp=sg2jSq=76D2A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 7, 2026 at 10:21 PM Zhijie Hou <houzhijie22(at)gmail(dot)com> wrote:
>
> I've started reviewing the 0001 patch and would like to suggest some refactoring
> to simplify the code in ReportApplyConflict(). The idea is to move the fallback
> logic into get_conflictlog_dest_and_table() so the caller's code looks cleaner.
>
> And I think we could build the errdetail for both the table and
> logfile cases and call ereport() only once, to reduce the duplicated code.
>
> Please check the attached follow-up patches (on top of 0001), I hope it makes
> the code better.
>

I also think so but we can go a bit further to simplify this part by
removing the two booleans and ERROR level check inside the
ReportApplyConflict() function. See attached built atop your patch.
Additionally, tried improving the comments atop
get_conflictlog_dest_and_table() in the attached.

--
With Regards,
Amit Kapila.

Attachment Content-Type Size
v79-simplify-code-topup-amit.1.txt text/plain 5.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Manu 2026-10-08 23:36:53 Re: [PATCH] Extensible ReadyForQuery wire protocol message and C hook, for connection pools and WAIT FOR LSN