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

[ENH] Full garbage collection #3194

Merged
merged 5 commits into from
Dec 5, 2024
Merged

Conversation

sanketkedia
Copy link
Contributor

@sanketkedia sanketkedia commented Nov 25, 2024

Description of changes

Summarize the changes made by this PR.

  • New functionality
    • Full garbage collection in spann

Test plan

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Documentation Changes

None

Copy link

Please tag your PR title with one of: [ENH | BUG | DOC | TST | BLD | PERF | TYP | CLN | CHORE]. See https://docs.trychroma.com/contributing#contributing-code-and-ideas

Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

// TODO(Sanket): Hook in the gc policy.
pub async fn garbage_collect(&self) -> Result<(), SpannIndexWriterConstructionError> {
// Get all the heads.
let non_deleted_heads;
Copy link
Collaborator

Choose a reason for hiding this comment

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

add a TODO for gc'ing HNSW

) -> Result<bool, SpannIndexWriterConstructionError> {
let hnsw_read_guard = self.hnsw_index.inner.read();
let hnsw_emb = hnsw_read_guard.get(head_id);
// TODO(Sanket): Check for exact error.
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should extend hnsw to tell you this

@sanketkedia sanketkedia force-pushed the 11-23-implement_update_and_delete branch from 4e2eb67 to 370a9d6 Compare December 4, 2024 09:56
@sanketkedia sanketkedia force-pushed the 11-25-basic_garbage_collection branch from b4f91db to 54e68c3 Compare December 4, 2024 17:20
@sanketkedia sanketkedia force-pushed the 11-23-implement_update_and_delete branch from bd5bdcf to 65dcb09 Compare December 4, 2024 17:39
@sanketkedia sanketkedia force-pushed the 11-25-basic_garbage_collection branch from 54e68c3 to 625451d Compare December 4, 2024 17:40
@sanketkedia sanketkedia force-pushed the 11-23-implement_update_and_delete branch from 65dcb09 to 2271983 Compare December 4, 2024 18:10
@sanketkedia sanketkedia force-pushed the 11-25-basic_garbage_collection branch from 625451d to 87c4dce Compare December 4, 2024 18:10
@sanketkedia sanketkedia force-pushed the 11-23-implement_update_and_delete branch from 2271983 to f6316fb Compare December 4, 2024 19:16
@sanketkedia sanketkedia force-pushed the 11-25-basic_garbage_collection branch from 87c4dce to 42d48d8 Compare December 4, 2024 19:16
@sanketkedia sanketkedia force-pushed the 11-23-implement_update_and_delete branch from f6316fb to c47a004 Compare December 4, 2024 19:26
@sanketkedia sanketkedia force-pushed the 11-25-basic_garbage_collection branch from 42d48d8 to ba29605 Compare December 4, 2024 19:26
@sanketkedia sanketkedia force-pushed the 11-23-implement_update_and_delete branch from c47a004 to 5d01f9c Compare December 5, 2024 08:54
@sanketkedia sanketkedia force-pushed the 11-25-basic_garbage_collection branch from ba29605 to 78bce69 Compare December 5, 2024 08:54
@sanketkedia sanketkedia force-pushed the 11-23-implement_update_and_delete branch from 5d01f9c to 084cb4a Compare December 5, 2024 09:27
@sanketkedia sanketkedia force-pushed the 11-25-basic_garbage_collection branch from 78bce69 to e9268e3 Compare December 5, 2024 09:27
@sanketkedia sanketkedia force-pushed the 11-23-implement_update_and_delete branch from 084cb4a to da226c5 Compare December 5, 2024 09:43
@sanketkedia sanketkedia force-pushed the 11-25-basic_garbage_collection branch from 151c5d5 to 1c04be4 Compare December 5, 2024 09:44
@sanketkedia sanketkedia force-pushed the 11-23-implement_update_and_delete branch 2 times, most recently from 9dc3377 to cc224ed Compare December 5, 2024 10:17
@sanketkedia sanketkedia force-pushed the 11-25-basic_garbage_collection branch from 1c04be4 to 8ce3f92 Compare December 5, 2024 10:17
@sanketkedia sanketkedia changed the base branch from 11-23-implement_update_and_delete to graphite-base/3194 December 5, 2024 10:24
@sanketkedia sanketkedia force-pushed the 11-25-basic_garbage_collection branch from 8ce3f92 to cd79a90 Compare December 5, 2024 10:25
@sanketkedia sanketkedia changed the base branch from graphite-base/3194 to main December 5, 2024 10:25
@sanketkedia sanketkedia force-pushed the 11-25-basic_garbage_collection branch from cd79a90 to ab7ce64 Compare December 5, 2024 10:25
Copy link
Contributor Author

sanketkedia commented Dec 5, 2024

Merge activity

  • Dec 5, 11:06 AM EST: A user started a stack merge that includes this pull request via Graphite.
  • Dec 5, 11:07 AM EST: A user merged this pull request with Graphite.

@sanketkedia sanketkedia merged commit 1caa19f into main Dec 5, 2024
71 of 72 checks passed
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