-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What does server state contain exactly? #3
Comments
Does it also mean that forked children don't need to obtain |
My idea was that the server doesn't store the full objects, just locks, along with the information that needs to be synchronized. The diagrams actually contain full information being exchanged: these are object IDs, and (in case of file handles) the position. For Dentries especially, actually no data needs to be kept: the assumption is that a dentry can be invalidated, and the client will reload it once it actually needs it. I'm not sure if that's a good idea, but it seems in line with the fact that dentries are only a cache, not source of truth. To go through your post:
Server keeps only "sync handles" / locks[1] for known dentries, i.e. information which client holds them. They are removed once the last client forgets them, or exits. (source code: deleting unused handle)
Yes, but that metadata can be stored on client only, and reloaded from the filesystem if necessary.
Good point... This design doesn't handle unlinking files that are open. I guess a dentry could have a
Same as above: there's no need to keep/synchronize information about all handles, only locking and the attributes that can be changed by client.
Yes. When the last client closes a handle with a given ID, it's automatically removed by the server.
Yes.
Yes, except for some initial communication with a server, to establish that they are using a given handle and dentry.
Right now, they still need to, because the server actually doesn't store full dentry data. But maybe that's a mistake, and any object (handle/dentry) should actually be fully rebuildable from server data? I thought that's unnecessary complexity, but we already have it in the checkpointing system. |
So yeah... it looks like I need to think about how it all fits with fork / checkpointing system. I would encourage you to take a look at the source (or try running it), but I realize you probably don't have too much time today. In any case, thank you very much for the questions, they're very helpful! |
Hmm, if you don't have inodes, how would you handle the following?
|
So, first of all: regardless of internal representation, how do we handle this for a file mounted from the host? We cannot delete it immediately. I know of a solution for a similar problem in FUSE: when deleting a file that is open, rename it to In terms of internal represenation, I think we can do a similar thing with dentries: for instance, mark the old dentry as "hidden" and superseded by the new one. When opening a new file, you would traverse this link, same as you traverse a symlink. I agree it sounds pretty hacky, and might make a good case for introducing inodes. On the other hand, I'm still not sure if it's justification enough, as it would make the server state more complicated. |
I'm fine with this hack, just please handle this scenario correctly :) |
From the README and diagrams, it's hard to understand what kind of
Server
state is kept. Also, it's not obvious what is the relationship betweenDentries
andHandles
.From what I understand:
Server
keeps all knowndentries
; they are never removedServer
keeps all knownhandles
Also:
rename
andsendfile
and maybe some more).Is this understanding correct?
The text was updated successfully, but these errors were encountered: