| From: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
|---|---|
| To: | shveta malik <shveta(dot)malik(at)gmail(dot)com> |
| Cc: | "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Álvaro Herrera <alvherre(at)kurilemu(dot)de>, Peter Smith <smithpb2250(at)gmail(dot)com> |
| Subject: | Re: Simplify code building the LR conflict messages |
| Date: | 2026-01-14 09:50:25 |
| Message-ID: | CAA4eK1Kp1Py6WSwaF4wqVPkHtFh6Nh+UFah_B3zmTKQcc1_3vQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Tue, Jan 13, 2026 at 9:52 AM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
>
> On Fri, Jan 9, 2026 at 7:07 PM Hayato Kuroda (Fujitsu)
> <kuroda(dot)hayato(at)fujitsu(dot)com> wrote:
> >
> > Dear Amit,
> >
> > > > > Fair enough. Also, with the current approach, we don't need to repeat
> > > > > the same LOG message (
> > > > > conflict (multiple_unique_conflicts) detected on relation
> > > > > "public.conf_tab") again and again even though we do similar things at
> > > > > other places[1] (the STATEMENT is repeated). If we have to follow your
> > > > > advice then I can think of following formats:
> > > ...
> > >
> > > As shown upthread, in existing places where we display the entire row,
> > > we don't use columns, so doesn't see why we need to be different here.
> > > I think but we can display for RI columns.
> >
> > Thanks for the suggestion. I've created the first draft based on the comment.
> >
> > While considering and implementing, I found that worker sometimes miss to read
> > information for indexes and relations due to the missing permissions. Previous
> > style just appended key/row/replica identity information at the bottom thus it
> > had less impacts.
> > However, it needs some branches if we tried to integrate into complete statements
> > to avoid constructing sentences at run-time.
> >
> > E.g., if we have complete information, the output can be like:
> >
> > ```
> > Key (a) = (1) already exists in unique index "tab_pkey", modified in transaction 777: local row (1, 1).
> > ```
> >
> > But if the worker cannot read the content of the index, the statement should be slightly different like:
> >
> > ```
> > Unique index "tab_pkey" rejects applying due to local row (1, 1), modified in transaction 77.
> > ```
> >
> > How do you feel? This patch may need idea to reduce lines.
> >
>
> I haven't looked at the code yet, but some initial thoughts while
> looking at the output:
>
> 1)
> DETAIL: Could not apply remote row (20, 10).
> DETAIL: Could not apply remote row (40, 200) by using replica
> identity (i)=(20).
>
> We generally "apply" in terms of insert, update, delete etc and not
> rows. Do you think we shall have:
> 'Could not apply remote change (20, 10)..'
>
> The most informative will be to say below, but since operation-type is
> already mentioned in Context, mentioning it here might not be needed.
> So we can say 'remote change'.
>
> DETAIL: Could not apply remote INSERT for row (30, 10).
> DETAIL: Could not apply remote UPDATE for row (40, 200) using replica
> identity (i)=(20).
>
IIRC, the operation is already displayed in the context message. Here,
we can say: DETAIL: Could not apply remote change using replica
identity (i)=(20): remote row (40, 200).
And adjust other messages accordingly.
--
With Regards,
Amit Kapila.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Amit Kapila | 2026-01-14 09:58:23 | Re: [Patch] add new parameter to pg_replication_origin_session_setup |
| Previous Message | Kirill Reshke | 2026-01-14 09:42:54 | Re: GIN pageinspect support for entry tree and posting tree |