Re: Conflict detection and logging in logical replication

shveta malik <shveta.malik@gmail.com>

From: shveta malik <shveta.malik@gmail.com>
To: "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>, "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>, shveta malik <shveta.malik@gmail.com>
Date: 2024-08-05T04:15:23Z
Lists: pgsql-hackers
On Sun, Aug 4, 2024 at 1:22 PM Zhijie Hou (Fujitsu)
<houzj.fnst@fujitsu.com> wrote:
>
> Here is the V11 patch set which addressed above and Kuroda-san[1] comments.
>

Thanks for the patch. Few comments:

1)
Can you please recheck conflict.h inclusion. I think, these are not required:
#include "access/xlogdefs.h"
#include "executor/tuptable.h"
#include "utils/relcache.h"

Only these should suffice:
#include "nodes/execnodes.h"
#include "utils/timestamp.h"

2) create_subscription.sgml:
For 'insert_exists' as well, we can mention that
track_commit_timestamp should be enabled *on the susbcriber*.

thanks
Shveta



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.