RE: Conflict Detection and Resolution

From: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Subject: RE: Conflict Detection and Resolution
Date: 2024-06-14 11:47:38
Message-ID: OS0PR01MB5716B158833DC181D08A7EF594C22@OS0PR01MB5716.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thursday, June 13, 2024 8:46 PM Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
>
> On 23.05.24 08:36, shveta malik wrote:
> > Conflict Resolution
> > ----------------
> > a) latest_timestamp_wins: The change with later commit timestamp
> wins.
> > b) earliest_timestamp_wins: The change with earlier commit timestamp
> wins.
> > c) apply: Always apply the remote change.
> > d) skip: Remote change is skipped.
> > e) error: Error out on conflict. Replication is stopped, manual
> > action is needed.
>
> You might be aware of pglogical, which has similar conflict resolution modes,
> but they appear to be spelled a bit different. It might be worth reviewing this,
> so that we don't unnecessarily introduce differences.

Right. Some of the proposed resolution names are different from pglogical's
while the functionalities are the same. The following is the comparison with
pglogical:

 latest_timestamp_wins(proposal) - last_update_wins(pglogical)
earliest_timestamp_wins(proposal) - first_update_wins(pglogical)
apply(proposal) - apply_remote(pglogical)
skip(proposal) - keep_local(pglogical)

I personally think the pglogical's names read more naturally. But others may
have different opinions on this.

>
> https://github.com/2ndquadrant/pglogical?tab=readme-ov-file#conflicts
>
> There might also be other inspiration to be found related to this in pglogical
> documentation or code.

Another difference is that we allow users to specify different resolutions for
different conflicts, while pglogical allows specifying one resolution for all conflict.
I think the proposed approach offers more flexibility to users, which seems more
favorable to me.

Best Regards,
Hou zj

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Lakhin 2024-06-14 12:00:00 Re: Remove dependence on integer wrapping
Previous Message Heikki Linnakangas 2024-06-14 11:37:35 TruncateMultiXact() bugs