couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Blakey <antony.bla...@gmail.com>
Subject Re: Trouble with replication
Date Fri, 30 Jan 2009 06:56:43 GMT

On 30/01/2009, at 5:17 PM, Chris Anderson wrote:

> On Thu, Jan 29, 2009 at 9:23 PM, Antony Blakey <antony.blakey@gmail.com 
> > wrote:
>>
>> On 30/01/2009, at 9:49 AM, Chris Anderson wrote:
>>
>>> What's happening in this scenario is that B is not getting any revs
>>> from A. Replication is one-way. I think if you always trigger
>>> replication both ways, then your nodes will be consistent (assuming
>>> they accept the same set of updates as valid).
>>
>> If you have > 2 nodes then that is no longer true. Consider three  
>> nodes A, B
>> and C where
>>
>> A: has a validation function F
>> B: a document that is invalid under F
>>
>> Replicating B -> C, A -> C is different than A -> C, B -> C, and  
>> there is no
>> global steady state that can be reached.
>
> I think it is the responsibility of the application to write sane
> validation functions. Also, I don't see how the order of incoming
> replications to C matters. Maybe you can spell it out for me.

B -> C : the document, invalid under F is replicated to C
A -> C : the validation function is replicated to C

   At this point, C has the document that would have failed F, and the  
validation function

If we do it in a different order, then:

A -> C : the validation function is replicated to C
B -> C : the document, invalid under F is replicated to C, but isn't  
accepted because it is invalid

   At this point, C has the validation function, but not the document  
that has failed

Extending this to update functions means that conflict resolution is  
no longer globally deterministic, because it depends on the  
propagation pattern of the update function. Same with validation and  
authentication.

This will only affect some use cases, but it's a very difficult  
problem in meshes.

Antony Blakey
-------------
CTO, Linkuistics Pty Ltd
Ph: 0438 840 787

In anything at all, perfection is finally attained not when there is  
no longer anything to add, but when there is no longer anything to  
take away.
   -- Antoine de Saint-Exupery



Mime
View raw message