Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Implement Garbage Collection #2022

Merged
merged 56 commits into from
Aug 26, 2019
Merged

Implement Garbage Collection #2022

merged 56 commits into from
Aug 26, 2019

Conversation

dirkmc
Copy link
Contributor

@dirkmc dirkmc commented May 8, 2019

@ghost ghost assigned dirkmc May 8, 2019
@ghost ghost added the status/in-progress In progress label May 8, 2019
@dirkmc dirkmc changed the base branch from master to feat/refs May 8, 2019 09:35
@dirkmc dirkmc force-pushed the feat/refs branch 2 times, most recently from ce7c41f to c731ddf Compare May 15, 2019 15:44
@dirkmc dirkmc changed the base branch from feat/refs to master May 16, 2019 19:37
@dirkmc dirkmc force-pushed the feat/gc branch 2 times, most recently from b37efc9 to a4bffb2 Compare May 21, 2019 22:50
@dirkmc dirkmc marked this pull request as ready for review May 28, 2019 19:34
@dirkmc
Copy link
Contributor Author

dirkmc commented May 28, 2019

Note: I needed to refactor the pinning code in order to share code with some GC functionality. The functionality hasn't changed, things have just moved around somewhat.

@wehriam
Copy link

wehriam commented Jun 3, 2019

@dirkmc thanks for working on this, and looking forward to the finish line.

We're using JS-IPFS to run 24/7 video streams in the browser; it is fairly quickly filling up all available disk.

Please let me know if there's anything I can do to assist.

@dirkmc
Copy link
Contributor Author

dirkmc commented Jun 3, 2019

@wehriam that's great to hear, thanks! It would be great to get some feedback from some different use cases. Would you like to try out this branch to see if it helps with your use case? I can provide instructions if you're not sure how

@wehriam
Copy link

wehriam commented Jun 3, 2019

@dirkmc thanks! We did a build off of feat/gc and are testing it now. It seems to be working well so far.

Are you planning support for Datastore options similar to those in go-ipfs? They aren't in the config parser so I wasn't sure.

We're currently using the navigator.storage.estimate() method (when available) to determine when to trigger GC.

Are all unpinned blocks removed on GC? It would be great to have a way to remove them on an LRU basis so browser-based swarms could serve as an edge cache for large files.

@dirkmc
Copy link
Contributor Author

dirkmc commented Jun 3, 2019

@wehriam the implementation of GC on this branch must be manually invoked, and removes all blocks that are unpinned and not in MFS. We are currently discussing how best to implement automatic GC, including using an LRU heuristic.

You can see usage information for the IPFS repo with ipfs.repo.stat()

@wehriam
Copy link

wehriam commented Jun 3, 2019

@dirkmc I have a fiddle running here - https://jsfiddle.net/t9a5ogc1/ - you can see usage stats in the console.

@wehriam
Copy link

wehriam commented Jun 14, 2019

This works well in our testing. Are there any blockers for a final release? It appears ipfs-inactive/interface-js-ipfs-core#460 has been successfully merged.

@dirkmc
Copy link
Contributor Author

dirkmc commented Jun 14, 2019

@wehriam thanks for helping out with testing this in a real world scenario.

We are currently all hands on deck getting ready for IPFS camp, so it's likely this will be released soon after, once people have had time to code review it.

@vasco-santos vasco-santos mentioned this pull request Jun 27, 2019
3 tasks
Copy link
Member

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a real quick first pass review - I'll circle back to this and do a proper review asap.

package.json Outdated Show resolved Hide resolved
src/core/components/pin/gc-lock.js Outdated Show resolved Hide resolved
src/core/components/pin/gc-lock.js Outdated Show resolved Hide resolved
src/core/components/pin/gc-lock.js Outdated Show resolved Hide resolved
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFC: js-ipfs Garbage Collection
9 participants