-
-
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
Pins with expiry times #4328
Comments
|
@whyrusleeping |
@djdv Hard to say without looking more deeply into this. But keeping the information separate might be a workable solution, it would definitely make iterating over the timed pins to do gc much easier. |
It'd also make sense to have "ipfs pin ls" show the time remaining, and maybe the time it was originally pinned for as well. Would running the pin command a second time for a hash reset the duration? |
I'm not sure it's worth it to work this into go-ipfs. The cost of reworking all the pinning-related code is very very high and it's arguably the most sensible part of the codebase because mistakes can lead to data loss. Would it work to build this on top of IPFS? It's as simple as calling |
The reason I suggested that it be built into go-ipfs is that it seems like a common pattern which would be most reliable if implemented once in go-ipfs. Could this possibly be implemented as a layer on top of the existing pinning code (within the same binary), internally using the ipfs pin API? Not familiar with the internals, so not sure if that would make sense. |
Personally, I'd kind of like to do away with "pinning" in general as it has some significant usability and scalability problems:
I'd like to just replace "pins" with a filesystem for files and a key/value store for DAG objects. This way, everything that's named is pinned and objects can have multiple names/pins. The tricky part here would be separating recursive and non-recursive pins (and all pins in-between) but, IMO, this is something that could be encoded within IPFS itself. That is, IPFS directory entries would include a pinning policy (recursive, directories only, delegate) for the linked file/directory. However, this would be an even larger undertaking (and probably won't happen for a while). I bring this up because I think we should avoid putting too much effort into improving the current system (beyond simply optimizing it). This wouldn't cover your direct use-case but, with this system, you could easily just name links to files based on their expiration times and GC them using an external system. Regardless of what we do, we will need to allow for external GCs as we can't account for all possible configurations in go-ipfs itself. |
I left a comment #4559 (comment) that probably should have gone in this thread instead. Basically, I think I agree with the rough take of @Stebalien's comment above: pinning needs a concept of ownership, and temporary pinning is better served by some RAII thing than timeouts: you want the client to open something like a transaction which when closed will tell the server it's OK to unpin. |
Version information: 0.4.11
Type: Feature / enhancement
Severity:
Description:
A few times I have wished that I could pin stuff (using the API, from a script that runs regularly), but only for a certain amount of time. This is useful for data which becomes less important after a certain amount of time to me. Without this feature, the client has to track pins in a database then remember to unpin over time.
It could potentially work like this:
ipfs pin $hash --hours=72
or
ipfs pin $hash --days=30
etc.
The text was updated successfully, but these errors were encountered: