Skip to content
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

Tracing GC for Backends #24

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Tracing GC for Backends #24

wants to merge 4 commits into from

Conversation

dgrnbrg
Copy link
Collaborator

@dgrnbrg dgrnbrg commented Sep 2, 2016

This is a sketch of how tracing GC could work for backends

@dgrnbrg dgrnbrg mentioned this pull request Sep 2, 2016
(loop []
(when-let [addr (pop-from-work-queue! gc-scratch)]
(observe-addr! gc-scratch addr)
(let [node (hh/resolve addr)]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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.

@cddr cddr mentioned this pull request Sep 3, 2016
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.
@cddr
Copy link
Contributor

cddr commented Sep 5, 2016

I had a stab at writing some tests for this. It shook out what appear to be a couple of bugs in the implementation.

@dgrnbrg
Copy link
Collaborator Author

dgrnbrg commented Sep 6, 2016

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 :)

@dgrnbrg dgrnbrg changed the title Initial tracing gc draft without testing Tracing GC for Backends Sep 6, 2016
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants