Skip to content

[ENH] Config to disable compactor on collections #3469

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 2 commits into from
Jan 13, 2025

Conversation

sanketkedia
Copy link
Contributor

@sanketkedia sanketkedia commented Jan 10, 2025

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • Can specify a list of collection ids that needs to disabled and compactor will respect that.
    • In runtime, can set the env CHROMA_COMPACTION_SERVICE__COMPACTOR__DISABLED_COLLECTIONS=[list of collection ids] or CHROMA_COMPACTION_SERVICE.COMPACTOR.DISABLED_COLLECTIONS=[list of collection ids] and the changes will take effect without restarting the pod

Test plan

How are these changes tested?

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

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@sanketkedia sanketkedia changed the title Disable compactor on certain collections [ENH] Config to disable compactor on collections Jan 10, 2025
@sanketkedia sanketkedia marked this pull request as ready for review January 10, 2025 23:11
.disabled_collections
.contains(&collection_info.collection_id)
{
tracing::info!(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we bump to warning so that if we ever disable info we aren't in the dark?

Copy link
Contributor

@codetheweb codetheweb left a comment

Choose a reason for hiding this comment

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

what is the tradeoff implementing the feature here vs. a flag in the sysdb? the sysdb approach feels a little cleaner to me and potentially more flexible

Say we have 1k collections, and there's a compaction bug affecting 1% of collections. To me it seems easier to bulk edit them in the sysdb rather than listing each one of the ten collections in a config somewhere.

@@ -8,4 +8,5 @@ pub(crate) struct CompactorConfig {
pub(crate) min_compaction_size: usize,
pub(crate) max_compaction_size: usize,
pub(crate) max_partition_size: usize,
pub(crate) disabled_collections: Vec<String>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Option<Vec<String>> for backwards compatibility/optional args.

Copy link
Contributor

@rescrv rescrv left a comment

Choose a reason for hiding this comment

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

Looks good if it passes CI.

@sanketkedia
Copy link
Contributor Author

The goal is to make this as operationally easy as possible. If we add a column in the sysdb table then the oncall will have to set/unset it which seems operationally harder than setting an ENV that takes effect immediately. It will also mean that we build tooling around this which is also something that I am trying to avoid.

Copy link
Collaborator

@HammadB HammadB left a comment

Choose a reason for hiding this comment

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

I somewhat agree with @codetheweb on this one that a change to the sysdb is better

  1. Move compactions to a Dead-letter-queue (DLQ) automatically
  2. Then "disabling compaction" becomes a manual DLQ move

We need 1 in general and 2 seems better to reuse the mechanism. I agree it needs some tooling though, but its a cleaner and more maintainable solution.

Maybe we add this, as we need it for oncall situations yesterday, and then we go add DLQ and deprecate this. Marking it as a HACK(1/11/2024) for now.

@codetheweb @sanketkedia wdyt?

@sanketkedia sanketkedia merged commit a632f2b into main Jan 13, 2025
79 checks passed
chroma-droid pushed a commit that referenced this pull request Jan 14, 2025
## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
- Can specify a list of collection ids that needs to disabled and
compactor will respect that.
- In runtime, can set the env
`CHROMA_COMPACTION_SERVICE__COMPACTOR__DISABLED_COLLECTIONS=[list of
collection ids]` or
`CHROMA_COMPACTION_SERVICE.COMPACTOR.DISABLED_COLLECTIONS=[list of
collection ids]` and the changes will take effect without restarting the
pod

## Test plan
*How are these changes tested?*
- [x] Tests pass locally with `pytest` for python, `yarn test` for js,
`cargo test` for rust

## Documentation Changes
None
chroma-droid pushed a commit that referenced this pull request Jan 14, 2025
## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
- Can specify a list of collection ids that needs to disabled and
compactor will respect that.
- In runtime, can set the env
`CHROMA_COMPACTION_SERVICE__COMPACTOR__DISABLED_COLLECTIONS=[list of
collection ids]` or
`CHROMA_COMPACTION_SERVICE.COMPACTOR.DISABLED_COLLECTIONS=[list of
collection ids]` and the changes will take effect without restarting the
pod

## Test plan
*How are these changes tested?*
- [x] Tests pass locally with `pytest` for python, `yarn test` for js,
`cargo test` for rust

## Documentation Changes
None
sanketkedia added a commit that referenced this pull request Jan 14, 2025
This PR cherry-picks the commit a632f2b
onto release/2025-01-10. If there are unresolved conflicts, please
resolve them manually.

Co-authored-by: Sanket Kedia <[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.

4 participants