Skip to content

[ENH]: don't skip GC for collection in fork tree if using GC v2 #4681

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

Merged
merged 1 commit into from
May 30, 2025

Conversation

codetheweb
Copy link
Contributor

@codetheweb codetheweb commented May 30, 2025

Description of changes

Does what the title says. Missed this in the original PR.

Test plan

How are these changes tested?

Updated the basic GC v2 E2E test to include a forked collection.

Documentation Changes

Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs section?

n/a

Copy link
Contributor

Enable GC v2 to Collect Root of Fork Trees for Collections

This PR updates the garbage collector logic to allow garbage collection on the root of fork trees when using GC version 2 (CleanupMode::DryRunV2 or CleanupMode::DeleteV2), whereas previously only GC v1 ran and always skipped such collections. The selection of orchestrator (v1 vs v2) is now determined by a new CleanupMode::is_v2() method, and all fork tree skipping logic is revised to only apply if GC v1 is active; GC v2 collections are now included during collection, with an updated test to cover the new behavior.

Key Changes:
• Introduced CleanupMode::is_v2() helper method to identify v2 modes.
• Refactored orchestrator selection to directly pick v2 implementation if using a v2 cleanup mode.
• Rewrote fork tree root skipping logic: only skip for GC v1, not v2.
• Expanded test to validate GC v2 operates on fork tree roots.
• Adjusted and clarified the logic around cleanup mode lookup in collection loop.

Affected Areas:
• rust/garbage_collector/src/garbage_collector_component.rs
• rust/garbage_collector/src/types.rs
• garbage collection test implementation

This summary was automatically generated by @propel-code-bot

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)

@codetheweb codetheweb requested a review from Sicheng-Pan May 30, 2025 17:47
@codetheweb codetheweb enabled auto-merge (squash) May 30, 2025 17:57
@codetheweb codetheweb merged commit 2d50100 into main May 30, 2025
72 checks passed
@codetheweb codetheweb deleted the fix-dont-skip-gc-fork-tree-for-v2 branch May 30, 2025 18:50
chroma-droid pushed a commit that referenced this pull request May 30, 2025
## Description of changes

Does what the title says. Missed this in the original PR.

## Test plan

_How are these changes tested?_

Updated the basic GC v2 E2E test to include a forked collection.

## Documentation Changes

_Are all docstrings for user-facing APIs updated if required? Do we need
to make documentation changes in the [docs
section](https://github.com/chroma-core/chroma/tree/main/docs/docs.trychroma.com)?_

n/a
codetheweb added a commit that referenced this pull request May 30, 2025
This PR cherry-picks the commit 2d50100
onto rc/2025-05-30. If there are unresolved conflicts, please resolve
them manually.

Co-authored-by: Max Isom <[email protected]>
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