RE: Conflict detection and logging in logical replication

Zhijie Hou (Fujitsu) <houzj.fnst@fujitsu.com>

From: "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>
To: Amit Kapila <amit.kapila16@gmail.com>, shveta malik <shveta.malik@gmail.com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, Nisha Moond <nisha.moond412@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>, Dilip Kumar <dilipbalaut@gmail.com>, Jan Wieck <jan@wi3ck.info>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Date: 2024-08-18T08:49:12Z
Lists: pgsql-hackers
On Friday, August 16, 2024 2:31 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
> 
> On Fri, Aug 16, 2024 at 10:46 AM shveta malik <shveta.malik@gmail.com>
> wrote:
> >
> > On Thu, Aug 15, 2024 at 12:47 PM Zhijie Hou (Fujitsu)
> > <houzj.fnst@fujitsu.com> wrote:
> > >
> > > Thanks. I have checked and merged the changes. Here is the V15 patch
> > > which addressed above comments.
> >
> > Thanks for the patch. Please find few comments and queries:
> >
> > 1)
> > For various conflicts , we have these in Logs:
> > Replica identity (val1)=(30).                (for RI on 1 column)
> > Replica identity (pk, val1)=(200, 20).  (for RI on  2 columns)
> > Replica identity (40, 40, 11).                (for RI full)
> >
> > Shall we have have column list in last case as well, or can simply
> > have *full* keyword i.e. Replica identity full (40, 40, 11)
> >
> 
> I would prefer 'full' instead of the entire column list as the complete column list
> could be long and may not much sense.

+1 and will change in V16 patch.

Best Regards,
Hou zj

Commits

  1. Rename the conflict types for the origin differ cases.

  2. Doc: explain the log format of logical replication conflicts.

  3. Log the conflicts while applying changes in logical replication.

  4. Avoid duplicate table scans for cross-partition updates during logical replication.