RE: Conflict detection and logging in logical replication
Zhijie Hou (Fujitsu) <houzj.fnst@fujitsu.com>
From: "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>
To: Nisha Moond <nisha.moond412@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>, Dilip Kumar <dilipbalaut@gmail.com>, shveta malik <shveta.malik@gmail.com>, Jan Wieck <jan@wi3ck.info>, Tomas Vondra <tomas.vondra@enterprisedb.com>, Amit Kapila <amit.kapila16@gmail.com>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Date: 2024-06-26T02:57:47Z
Lists: pgsql-hackers
Attachments
- v3-0002-Collect-statistics-about-conflicts-in-logical-rep.patch (application/octet-stream) patch v3-0002
- v3-0001-Detect-and-log-conflicts-in-logical-replication.patch (application/octet-stream) patch v3-0001
On Monday, June 24, 2024 8:35 PM Nisha Moond <nisha.moond412@gmail.com> wrote: > > On Mon, Jun 24, 2024 at 7:39 AM Zhijie Hou (Fujitsu) > <houzj.fnst@fujitsu.com> wrote: > > > > When testing the patch, I noticed a bug that when reporting the > > conflict after calling ExecInsertIndexTuples(), we might find the > > tuple that we just inserted and report it.(we should only report > > conflict if there are other conflict tuples which are not inserted by > > us) Here is a new patch which fixed this and fixed a compile warning > reported by CFbot. > > > Thank you for the patch! > A review comment: The patch does not detect 'update_differ' conflicts when > the Publisher has a non-partitioned table and the Subscriber has a partitioned > version. Thanks for reporting the issue ! Here is the new version patch set which fixed this issue. I also fixed some typos and improved the doc in logical replication conflict based on the comments from Shveta[1]. [1] https://www.postgresql.org/message-id/CAJpy0uABSf15E%2BbMDBRCpbFYo0dh4N%3DEtpv%2BSNw6RMy8ohyrcQ%40mail.gmail.com Best Regards, Hou zj
Commits
-
Rename the conflict types for the origin differ cases.
- 640178c92e3f 18.0 landed
-
Doc: explain the log format of logical replication conflicts.
- edcb71258504 18.0 landed
-
Log the conflicts while applying changes in logical replication.
- 9758174e2e5c 18.0 landed
-
Avoid duplicate table scans for cross-partition updates during logical replication.
- a67da49e1d98 18.0 cited