-
Notifications
You must be signed in to change notification settings - Fork 33
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
Rethinking pins #91
Comments
I welcome that discussion, the whole pinning concept in brig is not perfectly thought throughout and could use a review.
IIRC, the pin is only for the version. I agree that it would make more sense to make to make it per file. We would need a way to say that we only want (e.g.) 10 versions of this file. This could be a new hint introduced for a file or directory.
The semantics are, that this pin was pinned by brig, without the user's explicit consent. Explicit pins tell you that a user actually told the system to keep it. Current repinner therefore does not touch explict pins, since they have stronger guarantees.
I wouldn't call this pinned, since files without any pin, but with "IsCached" are "in transit" and might get deleted at any moment.
What do you mean by "invite"?
Good suggestion. As written above, this could be combined with the hint system to tell brig some details. So we could set things like this (option naming / syntax just for the sake of discussion): $ brig hints set /share --keep-versions 1
$ brig hints set /private --keep-versions 10
$ brig hints set /archive --keep-versions inf Or maybe even limit the maximum size of a directory before old versions get killed: $ brig hints set /share --max-cached-size 1G This would allow us to have only one kind of pin, but a highly configurable way to decide which file should be kept. Since hints (and pins) are always local they only apply to us. The remote side can have their set of hints that enforce the rules they wish for.
I think this can be considered a bug. When a file is downloaded, then it should be only cached. The user that synced with user should add their own rules on what files/versions to keep. If
As discussed in another ticket, we need a queue of pins that should be carried out. But I think I would vote for a similar way how hints does this: When setting a pin, a user can
Current pin status does not make sense, therefore your proposal makes sense. However, instead of adding more pin types I would reduce the number of different pins to 1 and make it configurable in another way. |
"invite" was used in the sense of setting the pin. I also like hints idea and switching |
Good, then let's tackle that as one item. I think it's an important thing and will make brig a lot better. The following this should be considered in the pin redesign:
Anything I forgot? |
I think you covered it well. One more item to track:
I will address |
Seems IPFS v0.8 adds a way to add a pin in the background: https://github.com/ipfs/go-ipfs/releases/tag/v0.8.0 |
There is also |
I was thinking what a
pin
means withinbrig
.First of all we have two types of pins:
I always thought that
explicit
stands for keep thisfile
at all cost with all its version. But it seems thatexplicit
actually means: keep this version of the file at all cost. Which scenario are we enforcing?
Second question, what is the role of a
regular pin
? It seems quite useless, in the presence of theexplicit
. It seems that it used internally byrepinner
to mark versions to be kept cached. Which bring us to the 3rdtype of pins
3. Cached or not flag, i.e. is the file pinned at backend.
So it seems we have too many pin types which serve somewhat similar function: pin file at the backed, which is the only thing which counts during use. Of course, I might be wrong about my deductions based on reverse engineering.
My main issue: to "invite" a pin during synchronization, you have to explicitly pin (well, we have sync type which pulls everything on sync, but I think it is not the main
brig
use case). But explicit pin, has meaning ofkeep me
which is somewhat orthogonal toget me
.I am still thinking about this situation, but I would say we need explicitly assign pins for different tasks.
The logic how we set pins 1-3 should be rethough as well. Currently if you sync repos metadata (without setting pins) and then do
brig cat fileCachedInRemote
it will be shown to a user, but funny things is that after a whilerepinner
removes it from the backend cache. Technically it is correct: user did not ask it to be pinned, but from other hand there is clearly a demand to have the file, unless there is a pressure to clear space.So maybe we need 4th type of a pin:
4. keep unless local space is needed.
Finally, setting any of above pins should immideately trigger
pin
at backend. Removing abrig pin
removes backend pin only if others are unset as well.I was thinking about above from the point of a mobile user, who has small disk space, and need to sync only
portions of the main repo.
Does it all make sense?
The text was updated successfully, but these errors were encountered: