couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikeal Rogers <mikeal.rog...@gmail.com>
Subject Re: Conflict resolution protocol
Date Wed, 23 Nov 2011 00:36:13 GMT
There is an API to write the resolution which is not documented. The workflow is also undocumented.
Randall promised he would write it up after he finishes the rewrites on PouchDB.

On Nov 22, 2011, at November 22, 20114:34 PM, Robert Newson wrote:

> There isn't one. There's only an algorithm to choose which conflict is
> shown if you are ignoring conflicts. Resolution must be done by client
> actions (deleting the revisions you don't want). The heuristic
> algorithm used attempts to shown the most reasonable available option
> (the one with the longest revision history, with ties broken by the
> sort order of the revisions if necessary).
> 
> B.
> 
> On 22 November 2011 23:37, Alex Besogonov <alex.besogonov@gmail.com> wrote:
>> I'm trying to understand the conflict resolution protocol of CouchDB
>> (the selection of the winning revision). So far I understand that
>> CouchDB does essentially this:
>> 
>> 1) Finds the revision with the highest number and if there are no
>> other revisions with the same number then it is declared the winner.
>> 2) If there are several revisions with the same revision number, then
>> the one with the lowest revision ID is selected (Erlang's string
>> comparison function is used to find the lowest string).
>> 
>> After the winner is found everything else is straightforward -
>> revision trees are aligned, conflicting revisions are stored, extra
>> revisions are stemmed, etc.
>> 
>> I'm going to document all of my findings for the future developers who
>> might be interested to use CouchDB with other systems.
>> 


Mime
View raw message