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

[BUG] fix multi collection log purge #2617

Merged
merged 4 commits into from
Aug 6, 2024
Merged

Conversation

codetheweb
Copy link
Contributor

@codetheweb codetheweb commented Aug 2, 2024

Description of changes

Fixes a bug where if any collection had dangling logs, any logs created after those by other collections would not get purged.

Also fixes a small, somewhat related bug with chroma utils vacuum (see PR comment below).

Test plan

How are these changes tested?

Added a new regression test that was formerly failing.

Documentation Changes

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

n/a

Copy link

github-actions bot commented Aug 2, 2024

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 fix-multi-collection-log-purge branch from 26bfdee to 501c48a Compare August 2, 2024 00:51
@@ -131,6 +131,7 @@ def vacuum(
settings.is_persistent = True
settings.persist_directory = path
system = System(settings=settings)
system.start()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixes a bug where if trigger_vector_segments_max_seq_id_migration() below attempted to load a segment, it would throw because the SQLite component wasn't technically started
this scenario happens when upgrading from an old version or when any collection had not yet hit its first sync_threshold persist trigger
was not caught because the CLI test didn't add any collections, I updated the test to trigger this path

Comment on lines -346 to -350
HNSWConfigurationInternal,
collection.get_model()
.get_configuration()
.get_parameter("hnsw_configuration")
.value,
Copy link
Contributor Author

@codetheweb codetheweb Aug 2, 2024

Choose a reason for hiding this comment

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

using .get_model().get_configuration() was always returning the default config
not sure if this was due to a recent change because I'm pretty sure it was working correctly when I added it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

alternative: a new multi-collection state machine that creates records
(this is harder than just modifying the existing multi-collection state machine because invariants can't inspect bundles)

@codetheweb codetheweb marked this pull request as ready for review August 5, 2024 22:42
chromadb/cli/cli.py Outdated Show resolved Hide resolved
chromadb/cli/cli.py Outdated Show resolved Hide resolved
@codetheweb
Copy link
Contributor Author

Reviewed in person with @HammadB.

@codetheweb codetheweb enabled auto-merge (squash) August 6, 2024 23:04
@codetheweb codetheweb merged commit 6d77a86 into main Aug 6, 2024
67 checks passed
@codetheweb codetheweb deleted the fix-multi-collection-log-purge branch August 7, 2024 15:50
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.

[Bug]: Automatic and CLI Log Purging not working with multiple collections
1 participant