Actually, the above strategy is not used by wave. The wave server
processes deltas sequentially, doing OT as needed depending on the
target version of the given delta.
The end result is dependent on the order in which the operations
arrive at the server.
If the wavelet document contents are:
characters("15")
and the delta from A is:
deleteCharacters("15")
characters("16")
and the delta from B is:
deleteCharacters("15")
characters("17")
the the resulting document contents will be either:
characters("16")
or
characters("17")
depending on which operation arrives first. If A arrives first then
the contents will be:
characters("17")
If B arrives first then the contents will be:
characters("16")
Essentially, last to arrive wins.
-Tad
On Mon, Nov 30, 2009 at 4:26 AM, Daniel Paull <[email protected]> wrote:
> Hi Jelke,
>
> I assume you mean that the operations by the two clients are performed
> concurrently. You are right in your thinking that the transformation
> is ambiguous - this is where OT starts to get tricky!
>
> Please refer the OT Functions section of the OT page on Wikipedia:
>
> http://en.wikipedia.org/wiki/Operational_transformation#OT_Functions
>
> which I will repoduce below:
>
> T(ins(p1,c1,sid1),ins(p2,c2,sid2)) :-
> if (p1 < p2) return ins(p1,c1,sid1)
> else if (p1 = p2 and sid1 < sid2) return ins(p1,c1,sid1)
> else return ins(p1 + 1,c1,sid1)
>
> Notice that when the insertion positions of two concurrent insert
> operations are equal (ie, when p1 = p2), the function resorts to
> comparing site identifiers, sid1 and sid2. It is required that site
> identifiers are globally unique and have a total ordering. Now the OT
> function is unambiguous and all sited will agree that the result is
> either "16" or that the result is "17", regardless of the order in
> which they apply the operations.
>
> Now, I'm not sure exactly what Wave does regarding site identifiers,
> but I am sure that the above strategy will be used.
>
>
> Cheers,
>
> Dan
>
>
> On Nov 29, 10:05 pm, "Jelke J. van Hoorn" <[email protected]> wrote:
>> Hi,
>>
>> I was looking the "under the hood" vidieo of Google IO 2009. And I'm
>> wondering what happens in the following situation:
>>
>> On the server a piece of text is lets say "15" and two clients alter
>> the same piece in "16" and "17" respectively.
>> What would be the outcome of the transforms? There is no unambigeous
>> way to cope with this edit I think.
>>
>> Grtz Jelke
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Wave Protocol" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/wave-protocol?hl=en.
>
>
>
--
You received this message because you are subscribed to the Google Groups "Wave
Protocol" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/wave-protocol?hl=en.