Re: Proposal: Conflict log history table for Logical Replication

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: shihao zhong <zhong950419(at)gmail(dot)com>
Cc: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(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>, shveta malik <shvetamalik(at)gmail(dot)com>
Subject: Re: Proposal: Conflict log history table for Logical Replication
Date: 2026-11-01 05:14:46
Message-ID: CAA4eK1LHXu10A=r3NRBmaaFS=x9v0Yg6u_qh8sMkJfXuXv1nng@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Nov 1, 2026 at 5:46 AM shihao zhong <zhong950419(at)gmail(dot)com> wrote:
>
> Sorry, I was not clear. The code is fine, I only meant the comment.
>
> update_exists also passes NULL, but a search did happen before it.
> So "NULL if no search was done" is not quite right.
>

How about changing it to: "NULL for ERROR-level insert/update conflicts."?

>
> 0002 looks good. Maybe add a hint to the new error in
> lock_conflictlog_relation(), like the two in subscriptioncmds.c.
>

How about adding detail and hint as follows:

ereport(ERROR,
errcode(ERRCODE_LOCK_NOT_AVAILABLE),
errmsg("could not obtain lock on conflict log table of subscription \"%s\"",
MySubscription->name));
errdetail("A prepared transaction of this subscription may hold a lock
on its conflict log table, and another session is waiting on it."),
errhint("If a session is waiting for that lock, cancel it and let the
apply worker retry."));

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tender Wang 2026-11-01 06:11:41 Re: Remove unused arguments from split_selfjoin_quals()
Previous Message mingjiegao 2026-11-01 04:19:34 [PATCH v1] Fix initial sync of zero-column published tables