RE: Conflict detection and logging in logical replication

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

From: "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>
To: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, Amit Kapila <amit.kapila16@gmail.com>, shveta malik <shveta.malik@gmail.com>
Cc: 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-21T09:33:02Z
Lists: pgsql-hackers
On Wednesday, August 21, 2024 1:31 PM Kuroda, Hayato/黒田 隼人 <kuroda.hayato@fujitsu.com> wrote:
> 
> Dear Hou,
> 
> Thanks for updating the patch! I think the patch is mostly good.
> Here are minor comments.

Thanks for the comments !

> 
> 02.
> ```
> +     <para>
> +      The <literal>key</literal> section in the second sentence of the
> ...
> ```
> 
> I preferred that section name is quoted.

I thought about this. But I feel the 'key' here is not a real string, so I chose not to
add quote for it.

> 
> 0002:
> 
> 03.
> ```
> -#include "replication/logicalrelation.h"
> ```
> 
> Just to confirm - this removal is not related with the feature but just the
> improvement, right?

The logicalrelation.h becomes unnecessary after adding worker_intenral.h, so I
think it's this patch's job to remove this.

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.