Re: Proposal: Conflict log history table for Logical Replication

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(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-10-31 04:47:02
Message-ID: CAGRkXqR=qYfxZQ95Mm1yGbKt+MVkknW2sBR6mUbggdrihiCx+Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Amit and Dilip,

Thanks for the fix! All six LOG callers pass the entry the search used.

Two things:

1. The new comment says relmapentry is NULL when no search was done.
But update_exists also passes NULL, and it did search.

2. Get_tuple_desc() still calls GetRelationIdentityOrPK(), so with
conflict_log_destination = 'all' the log and the table can disagree.

I hit it with the apply-update-before-open-indices injection point
and DROP INDEX CONCURRENTLY on the replica identity index on x. The
table row has {"x":"7"}, but the log for the same conflict says

replica identity (z)=(107).

z is the pk

Should we pass the same index down there too
and drop the XXX?

repro attached.

Thanks,
Shihao

Attachment Content-Type Size
conflict_key_race.pl text/x-perl-script 3.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message shihao zhong 2026-10-31 04:58:04 Re: improving handling of FPIs during recovery prefetching
Previous Message shihao zhong 2026-10-31 04:16:59 Re: [PG19] Bogus errors for polymorphic plpython functions