Tracing GC for Backends#24
Open
dgrnbrg wants to merge 4 commits into
Open
Conversation
Closed
| (loop [] | ||
| (when-let [addr (pop-from-work-queue! gc-scratch)] | ||
| (observe-addr! gc-scratch addr) | ||
| (let [node (hh/resolve addr)] |
Collaborator
Author
There was a problem hiding this comment.
This resolve should only be necessary if the current node is an index node. However, we currently can't tell from an address if we're looking at an index or data node, and so we also resolve all data nodes, which is terrible for perf. IResolve should have a method index? or something, so that we can dramatically reduce the IO by never reading data nodes into memory.
The test builds two random b-trees, and then uses one of them as a gc root, and including the other in the lazy sequence of "all keys" to be dealt with by the collector. After running a gc, we assert that the `deleted-fn` has been invoked against all the "dead" nodes.
Contributor
|
I had a stab at writing some tests for this. It shook out what appear to be a couple of bugs in the implementation. |
Collaborator
Author
|
Thank you for the testing! I want to ponder this a bit more, and then merge it so that it can be consumed by other backends :) |
csm
pushed a commit
to csm/hitchhiker-tree
that referenced
this pull request
Sep 18, 2016
This pulls in datacrypt-project#24, since I'd like to test out the GC too.
csm
pushed a commit
to csm/hitchhiker-tree
that referenced
this pull request
Nov 18, 2019
Based partially on datacrypt-project#24 Rewritten to primarily use core.async. * src/hitchhiker/tree/konserve.cljc (create-id): new function; prepends the current timestamp as hex to the UUID key. (KonserveBackend.-write-node): use create-id to generate the storage ID. * src/hitchhiker/tree/tracing-gc/konserve.cljc: new namespace. * src/hitchhiker/tree/tracing-gc.cljc: new namespace. * .gitignore: ignore IntelliJ files. * project.clj: update konserve to 0.6.0-SNAPSHOT.
csm
pushed a commit
to csm/hitchhiker-tree
that referenced
this pull request
Nov 18, 2019
Based partially on datacrypt-project#24 Rewritten to primarily use core.async. * src/hitchhiker/tree/konserve.cljc (create-id): new function; prepends the current timestamp as hex to the UUID key. (KonserveBackend.-write-node): use create-id to generate the storage ID. * src/hitchhiker/tree/tracing-gc/konserve.cljc: new namespace. * src/hitchhiker/tree/tracing-gc.cljc: new namespace. * .gitignore: ignore IntelliJ files. * project.clj: update konserve to 0.6.0-SNAPSHOT.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a sketch of how tracing GC could work for backends