On Thu, Jul 16, 2020, 5:23 AM evdubs <[email protected]> wrote:

> Do you think you'll need to try to identify the order that the events were
> created in?
>
> What if user A does:
>
> $ touch file.txt
> $ rm file.txt
>
> And what if user A had separately done:
>
> $ rm file.txt
> Error: file not found
> $ touch file.txt
>

You meant for those to be user A and user B, right?


> Would those operations both potentially create File-Create P H1 ;
> File-Delete P H1 events when things are allowed to be out of order? Don't
> they result in different states for the filesystem? If you also sent along
> the time of the operation (or maybe some sequence number), won't that let
> you keep things ordered and not make decisions that might be ambiguous?
>

Fair question. Yes, time will be sent along with the message. I was trying
to boil things down as far as possible and perhaps I boiled too long.

Of course, that raises its own issues about different timezones etc, but
those are separate from the issue at hand.

To answer your specific question: That sequence of events results in a
conflict that will be flagged for human review.

On Wednesday, July 15, 2020 at 10:29:36 PM UTC-10 [email protected] wrote:
>
>> tl;dr
>> Can anyone recommend a data structure that is ordered and supports
>> efficient reordering, insertion at arbitrary location, and deletion?
>>
>> Long form:
>>
>> I'm working on an operation-log reconciliation problem, where each
>> operation is one of:
>>
>>   File-Create    P H
>>   File-Update   P H
>>   File-Delete    P H
>>   Folder-Create P
>>   Folder-Delete P
>>
>> P = path
>> H = hash of the file (e.g. md5)
>>
>> Operation messages travel over the network, meaning that they could
>> arrive out of order.  (They could also be missed entirely, but that's a
>> separate problem that I'm not working on yet.)
>>
>> Specifically, I want to be able to take a series of messages and collapse
>> them where appropriate.  For example:
>>
>>   File-Update P H1 -> H2
>>   File-Create P1 H1
>> Result after collapse:
>>   '(File-Create P1 H2)
>>
>>   File-Create P H1
>>   File-Delete P H1
>> Result after collapse:
>>   '()
>>
>>   File-Delete P X
>>   File-Create P X
>> Result after collapse:
>>   '()
>>
>>   File-Delete P1 H1
>>   File-Create P2 H2
>>   File-Create P1 H1
>> Result after collapse:
>>   '(File-Create P2 H2)
>>
>> I've been mulling over various ways to handle all of this and digging
>> around to find examples of other people doing it, but I'm wondering if
>> there's a data structure or existing algorithm that will handle it
>> cleanly.  Does anyone know of such a thing?
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/f03b33d8-e286-4cc2-afa5-4aefd0050bd5n%40googlegroups.com
> <https://groups.google.com/d/msgid/racket-users/f03b33d8-e286-4cc2-afa5-4aefd0050bd5n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAE8gKofT_R%3D-d8QEinouq8id16f7WJE2jpn5SE%2BqXPCgmODaXw%40mail.gmail.com.

Reply via email to