9front - general discussion about 9front
 help / color / mirror / Atom feed
From: "Frank D. Engel, Jr." <fde101@fjrhome.net>
To: 9front@9front.org
Subject: Re: [9front] Enabling a service
Date: Wed, 8 May 2024 12:33:13 -0400	[thread overview]
Message-ID: <959215bb-a8d0-40b9-bbd5-89c21a90c9ac@fjrhome.net> (raw)
In-Reply-To: <9df183e7-7a94-4d58-9a68-2dbc0e73018f@posixcafe.org>

When you perform a write, you send that write to the file server on the 
remote system and it updates the block, generating the appropriate 
hash.  If another client sends a write with a collision, the file server 
handles it the same way it already would - the two are ultimately 
processed in some order or another.

Each client system may have updated a locally cached copy of the block 
with the same written data, but if the data did not match what was 
generated on the file server because it was updated in the meantime, 
then the hash on the client system will not match what the remote server 
came up with.

Consequently, when it later tries to read that block again, the file 
server sends it the hash that it has, which does not exist in the local 
cache, so the client is forced to request the correct block from the 
file server instead of using the locally cached copy.

Similarly, the other client performed its write and has yet another 
different hash, since the server has the data from both clients.  When 
that client tries to perform another read, its hash won't match either, 
forcing it too to obtain the correct copy of the data from the file server.

Had only one of them been manipulating the data, then that one would 
have the correct copy with a matching hash, so it would be able to use 
its local copy.


On 5/8/24 12:10, Jacob Moody wrote:
> On 5/8/24 10:49, Frank D. Engel, Jr. wrote:
>> How did it work for Venti when there were multiple users?
> My understanding of venti is somewhat limited to take my explanation with a grain of salt.
> If you have divergent fossils using the same venti you will get divergent root scores, they
> become two paths that have to be merged manually.
>
>> You still have a single source of truth on the file server as all of the
>> data would still be written there with this approach and it would still
>> manage the directory structure, so any data that would come from other
>> users would ultimately just be pulled from the file server and loaded
>> into their cache separately.
> I got your proposal the wrong way around, you are talking about a local
> venti and a remote fossil. At the point you decide that you want a single
> remote source of truth(filesystem) that everyone must reconcile with you are still going
> to have issues with merging. Venti works as a backing for multiple disjoint fossils
> because it has no single source of truth for the filesystem, it just stores blocks.
>
> No matter how you cut you are going to have to deal with multiple people merging
> their cache in to the single root of truth with potentially latent updates.
> Either you have to serialize all mutations at the source of truth (and at that point
> you are latent bound) or you have to be clever about merging. A lot of ink has been
> spilled about this problem in the scope of web programming (CRDs iirc), perhaps
> that may serve as some inspiration.
>
>> One challenge might seem to be simultaneous writes to different parts of
>> the same block, but in this case the locally calculated hash for the
>> block that was written to cache would (hopefully) not match the one
>> calculated by the file server which would reflect both updates, so when
>> the read would occur the file server would send a hash that would not be
>> in the local cache and the read would be sent across to the file server
>> for the updated block, with the incorrect local block eventually being
>> aged out of the cache as it started to fill up.
>>
>>
> Reading this and rereading your previous email I still do not fully understand
> how you plan to deal with collisions. If you have a local cache that you write
> to first and then you slowly drain that to the remote system you are still
> going to have merge issues. The fileserver is going to say at some point "No
> this is based on stale information" and you'll have to figure out out to retroactively
> reconcile this error with a system that has already forgotten this request.
>
>


  reply	other threads:[~2024-05-08 16:35 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-06 11:32 Rocky Hotas
2024-05-06 11:58 ` Alex Musolino
2024-05-06 12:43 ` ori
2024-05-06 15:16   ` Scott Flowers
2024-05-06 15:37     ` sirjofri
2024-05-06 16:32     ` Stanley Lieber
2024-05-06 22:18   ` Rocky Hotas
2024-05-06 22:59     ` ori
2024-05-06 23:00     ` ori
2024-05-07  8:22       ` Rocky Hotas
2024-05-07  8:29         ` Frank D. Engel, Jr.
2024-05-07  9:03           ` Rocky Hotas
2024-05-07  9:14         ` sirjofri
2024-05-07 21:11           ` Shawn Rutledge
2024-05-07 21:35             ` Kurt H Maier
2024-05-07 21:45               ` sirjofri
2024-05-07 21:54             ` sl
2024-05-07 21:58               ` sl
2024-05-07 23:15                 ` Lennart Jablonka
2024-05-07 23:16                 ` Shawn Rutledge
2024-05-07 23:45                   ` Shawn Rutledge
2024-05-08  0:34                   ` Kurt H Maier
2024-05-08  0:35                   ` sl
2024-05-08  1:05                     ` Jacob Moody
2024-05-08  1:24                       ` sl
2024-05-08  7:22                         ` hiro
2024-05-08 14:04                           ` Stanley Lieber
2024-05-08 12:08                         ` Stuart Morrow
2024-05-08 16:37                           ` Brian Stuart
2024-05-08 20:16                             ` hiro
2024-05-08 21:26                               ` Stuart Morrow
2024-05-08 21:17                             ` Disconnection-tolerant / distributed filesystems (was Re: [9front] Enabling a service) Shawn Rutledge
2024-05-08 14:25                         ` [9front] Enabling a service Jacob Moody
2024-05-08  3:41                       ` Ori Bernstein
2024-05-08  4:09                         ` sl
2024-05-08  8:39                           ` Frank D. Engel, Jr.
2024-05-08 14:17                             ` Jacob Moody
2024-05-08 15:49                               ` Frank D. Engel, Jr.
2024-05-08 16:10                                 ` Jacob Moody
2024-05-08 16:33                                   ` Frank D. Engel, Jr. [this message]
2024-05-08 17:27                                     ` Jacob Moody
2024-05-08 18:00                                       ` Steve Simon
2024-05-08 19:46                                         ` hiro
2024-05-08 19:46                                   ` Roberto E. Vargas Caballero
2024-05-08 20:34                                     ` tlaronde
2024-05-08 14:57                   ` Lucas Francesco
2024-05-08 15:10                     ` an2qzavok
2024-05-08  2:11             ` Thaddeus Woskowiak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=959215bb-a8d0-40b9-bbd5-89c21a90c9ac@fjrhome.net \
    --to=fde101@fjrhome.net \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).