On Wed, Oct 7, 2026 at 10:21 PM Zhijie Hou <houzhijie22@gmail.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.