Re: Conflict Detection and Resolution - Mailing list pgsql-hackers

From Nisha Moond
Subject Re: Conflict Detection and Resolution
Date
Msg-id CABdArM6_G5_YAAccCtp71OQQmYrNK6dMxwC6C_BkUvy+NjLZWA@mail.gmail.com
Whole thread Raw
In response to Re: Conflict Detection and Resolution  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: Conflict Detection and Resolution
Re: Conflict Detection and Resolution
List pgsql-hackers
Please find the attached  'patch0003', which implements conflict
resolutions according to the global resolver settings.

Summary of Conflict Resolutions Implemented in 'patch0003':

INSERT Conflicts:
------------------------
1) Conflict Type: 'insert_exists'

Supported Resolutions:
a) 'remote_apply': Convert the INSERT to an UPDATE and apply.
b) 'keep_local': Ignore the incoming (conflicting) INSERT and retain
the local tuple.
c) 'error': The apply worker will error out and restart.

UPDATE Conflicts:
------------------------
1) Conflict Type: 'update_differ'

Supported Resolutions:
a) 'remote_apply': Apply the remote update.
b) 'keep_local': Skip the remote update and retain the local tuple.
c) 'error': The apply worker will error out and restart.

2) Conflict Type: 'update_missing'

Supported Resolutions:
a) 'apply_or_skip': Try to convert the UPDATE to an INSERT; if
unsuccessful, skip the remote update and continue.
b) 'apply_or_error': Try to convert the UPDATE to an INSERT; if
unsuccessful, error out.
c) 'skip': Skip the remote update and continue.
d) 'error': The apply worker will error out and restart.

DELETE Conflicts:
------------------------
1) Conflict Type: 'delete_missing'

Supported Resolutions:
a) 'skip': Skip the remote delete and continue.
b) 'error': The apply worker will error out and restart.

NOTE: With these basic resolution techniques, the patch does not aim
to ensure consistency across nodes, so data divergence is expected.

--
Thanks,
Nisha

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: long-standing data loss bug in initial sync of logical replication
Next
From: Yugo NAGATA
Date:
Subject: Re: Document NULL