Skip to content

[ENH]: ListCollectionsToGc returns lineage file path, group by fork tree, accept optional tenant for filtering #4529

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

Conversation

codetheweb
Copy link
Contributor

@codetheweb codetheweb commented May 12, 2025

Description of changes

Includes several updates to the ListCollectionsToGc gRPC method:

  • returns the lineage file path, if present
  • only returns the root collection for fork trees
  • accepts an optional tenant parameter for test isolation.

Because ListCollectionsToGc now returns collections that are part of fork trees, I also updated GC to skip collections with a populated lineage_file_path (i.e. the root collection in a fork tree).

Test plan

How are these changes tested?

Added tests covering the fork tree grouping and GC behavior on forked collections.

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

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 force-pushed the feat-sysdb-collections-to-gc-return-lineage-file-path branch from 0b0d572 to 2570a94 Compare May 12, 2025 18:22
Copy link
Contributor Author

@codetheweb codetheweb force-pushed the feat-sysdb-collections-to-gc-return-lineage-file-path branch 2 times, most recently from f6cc527 to 82416a2 Compare May 12, 2025 21:49
@codetheweb codetheweb changed the title [ENH]: ListCollectionsToGc should return lineage file path, group by fork tree [ENH]: ListCollectionsToGc returns lineage file path, group by fork tree, accept optional tenant for filtering May 12, 2025
@codetheweb codetheweb marked this pull request as ready for review May 12, 2025 21:54
@codetheweb codetheweb requested a review from Sicheng-Pan May 12, 2025 21:55
Copy link
Contributor

propel-code-bot bot commented May 12, 2025

Enhanced ListCollectionsToGc for Fork Tree Management

This PR enhances the ListCollectionsToGc gRPC method to return lineage file paths, group collections by fork trees, and add tenant filtering capability. The changes also update the garbage collector to skip collections with lineage files to prevent premature cleanup of fork trees.

Key Changes:
• Modified ListCollectionsToGc to return lineage file path information
• Changed query logic to group by fork trees and only return root collections
• Added tenant parameter for filtering collections during GC
• Updated garbage collector to skip collections with lineage files

Affected Areas:
• gRPC API contracts for garbage collection
• Garbage collector component
• Collection model and database query logic

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

@codetheweb codetheweb force-pushed the feat-sysdb-collections-to-gc-return-lineage-file-path branch from 82416a2 to 9e05d4e Compare May 12, 2025 21:58
@codetheweb codetheweb force-pushed the feat-sysdb-collections-to-gc-return-lineage-file-path branch 2 times, most recently from d493aff to 8e91522 Compare May 12, 2025 23:01
@codetheweb codetheweb requested a review from Sicheng-Pan May 12, 2025 23:01
@codetheweb codetheweb force-pushed the feat-sysdb-collections-to-gc-return-lineage-file-path branch from 8e91522 to dc6a82f Compare May 12, 2025 23:03
@codetheweb codetheweb enabled auto-merge (squash) May 12, 2025 23:08
@codetheweb codetheweb merged commit aaece7b into main May 12, 2025
71 checks passed
@codetheweb codetheweb deleted the feat-sysdb-collections-to-gc-return-lineage-file-path branch May 13, 2025 00:01
itaismith pushed a commit that referenced this pull request May 23, 2025
… tree, accept optional tenant for filtering (#4529)

## Description of changes

Includes several updates to the `ListCollectionsToGc` gRPC method:

- returns the lineage file path, if present
- only returns the root collection for fork trees
- accepts an optional tenant parameter for test isolation.

Because `ListCollectionsToGc` now returns collections that are part of
fork trees, I also updated GC to skip collections with a populated
`lineage_file_path` (i.e. the root collection in a fork tree).

## Test plan

_How are these changes tested?_

Added tests covering the fork tree grouping and GC behavior on forked
collections.

## 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
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