-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Store pins in MFS #4675
Comments
@Stebalien I assume you already know this, but right now anything under the MFS is pinned via a best-effort policy. What that means is that it won't be gc, but removing it or any of its children won't be blocked. Maybe a recursive pin could be implemented as a sort of read-only flag. That is removing anything with the flag will be blocked until the flag is removed, although there are probably a lot of implementation details that need to be worked out, for example the handling of indirect pins. Now direct pins don't really fit into this model as the gc is free to remove any direct pins children. |
For context, one of my goals here is to make IPFS usable for DAPPs. For this to happen, we need to be able to have namespaces and I'd like to use MFS for that (a nice, simple, single namespace).
You mean by
Proposal:
Yeah. I think we'd need some way to associate pin/prefetch information with directory entries to do this. However, this is generally useful in unixfs so I think we'll want it anyways (for smart GC/prefetching). |
Well that and
It was a compromise that me and @whyrusleeping agreed on. The problem was before that anything inside the MFS would of been garbage collected since it wasn't pinned. A recursive pin was not appropriate because a recursive pin implies the entire dag is locally available, which is not always the case for something under the MFS root. For example only some of the directory entries may be available locally. Thus the best-effort pin was created in which the GC will keep anything it can reach from the MFS root but won't complain if some of the children or missing. It is called best-effort because some children which are part of the dag may be unintentionally removed if any of the internal nodes pointing to the child are not available locally. |
Wouldn't that be equivalent to
I actually prefer MFS's reachability approach. The "middle-ground" I was talking about with
And |
In a way I guess since the block is not actually removed from the local repo, sorry I momentarily blanked on what
Except that if something is corrupted (for example a block is missing) the GC could accidentally remove important data, that is why the GC aborts if any part of a dag of any the recursive pins is not available.
Actually it doesn't force anything. It checks if a block is pinned and will refuse to remove it. There is no way to force remove a pinned file; you will first have to unpin it. |
This would also mean loss of direct pins feature. If we are ok with it it would be quite nice as it would simplify GC code. |
@Kubuxu We can do this but we'd need some concept of "pin policies" in unixfs. |
There are really two ways I can see this happening and I don't think it'll be much of an issue:
Basically, users are used to filesystems so I'd prefer to just give them filesystem semantics.
I consider MFS and pinning to be two ways to "keep" blocks from being GCed. However, |
Motivations:
ipfs pin
command while not having to maintain a bunch of deprecated code.Blockers:
ipfs files cp --prefetch
flag, maybe even a--prefetch=background
flag?The text was updated successfully, but these errors were encountered: