Re: Conflict Detection and Resolution

From: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
To: shveta malik <shveta(dot)malik(at)gmail(dot)com>
Cc: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Ajin Cherian <itsajin(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Jan Wieck <jan(at)wi3ck(dot)info>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>
Subject: Re: Conflict Detection and Resolution
Date: 2024-08-21 10:38:00
Message-ID: CABdArM6Y2vHzDDCMz224sUFmHmJvqn9L=Lhqcy+tetcetQkoPQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The patches have been rebased on the latest pgHead following the merge
of the conflict detection patch [1]. The detect_conflict option has
been removed, and conflict detection is now enabled by default. This
change required the following updates in resolver patches:
patch-0001:
- Removed dependency on the detect_conflict option. Now, default
conflict resolvers are set on CREATE SUBSCRIPTION if no values are
provided.
- To keep the behavior unchanged, the default resolvers are now set as -
insert_exists = error
update_exists = error
update_differ = apply_remote
update_missing = skip
delete_missing = skip
delete_differ = apply_remote
- Added documentation for conflict resolvers.

patch-0002:
- Removed dependency on the detect_conflict option.
- Updated test cases in 034_conflict_resolver.pl to reflect new
default resolvers and the removal of the detect_conflict option.

patch-0003:
- Implemented resolver for the update_exists conflict type. Supported
resolvers are: apply_remote, keep_local, error.

*The timestamp-based resolution patch is not yet rebased due to its
dependency on the detect_conflict option for handling two-phase and
parallel apply-worker workflows. The behavior needs to be reassessed.

To Do:
patch-0001: Add support for pgdump.
patch-0002 and 0003:
- Optimize by avoiding the pre-scan for conflicts in insert_exists
and update_exists when the resolver favors error or skips applying
remote changes.
- Improve the current recursive method used for multiple key conflict
resolution in update_exists.

Thanks Ajin for working on the docs.

[1] - https://www.postgresql.org/message-id/CAA4eK1%2BKb4i64cRD7MCUGkABNzBgQkP8vr5t01N%2BL_8GtwPgcA%40mail.gmail.com

--
Thanks,
Nisha

Attachment Content-Type Size
v9-0001-Add-CONFLICT-RESOLVERS-into-the-syntax-for-CREATE.patch application/octet-stream 47.4 KB
v9-0002-Conflict-resolvers-for-insert-update-and-delete.patch application/octet-stream 58.4 KB
v9-0003-Conflict-resolution-for-update_exists-conflict-ty.patch application/octet-stream 15.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2024-08-21 10:48:03 Re: CREATE SUBSCRIPTION - add missing test case
Previous Message Amit Kapila 2024-08-21 10:35:21 Re: Conflict detection and logging in logical replication