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] updates & invalid operations should also trigger persisting of local HNSW #2499

Merged
merged 15 commits into from
Jul 15, 2024

Conversation

codetheweb
Copy link
Contributor

@codetheweb codetheweb commented Jul 10, 2024

The benefits aren't immediately clear in this PR, but this allows future work to correctly track the maximum sequence ID.

Depends on #2511.

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 marked this pull request as ready for review July 10, 2024 23:47
@codetheweb codetheweb requested a review from HammadB July 10, 2024 23:47
@codetheweb codetheweb requested a review from HammadB July 11, 2024 17:17
@codetheweb codetheweb changed the title [ENH] upserts should also trigger persisting of local HNSW [ENH] upserts & invalid operations should also trigger persisting of local HNSW Jul 11, 2024
with_persistent_hnsw_params=True,
# By default, these are set to 2000, which makes it unlikely that index mutations will ever be fully flushed
max_hnsw_sync_threshold=10,
max_hnsw_batch_size=10,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

without reducing the sync threshold, this test will almost never fully flush to disk, which makes the correctness guarantee weaker

without this change, the pickled metadata file was never loaded

@@ -336,6 +344,10 @@ def test_cycle_versions(
name=collection_strategy.name,
embedding_function=not_implemented_ef(), # type: ignore
)

# Should be able to add embeddings
coll.add(**embeddings_strategy) # type: ignore
Copy link
Contributor Author

Choose a reason for hiding this comment

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

causes the pickled metadata file to be loaded, a good thing to test since the class def changed and it needs special handling

@codetheweb codetheweb changed the title [ENH] upserts & invalid operations should also trigger persisting of local HNSW [ENH] updates & invalid operations should also trigger persisting of local HNSW Jul 12, 2024
@codetheweb codetheweb changed the base branch from main to fix-persistent-hnsw-config-migration July 12, 2024 19:01
Base automatically changed from fix-persistent-hnsw-config-migration to main July 15, 2024 19:49
@codetheweb codetheweb merged commit 37c54df into main Jul 15, 2024
65 checks passed
@codetheweb codetheweb deleted the fix-upsert-persist branch July 15, 2024 22:38
codetheweb added a commit that referenced this pull request Jul 15, 2024
Didn't catch after a refactor in #2499.

This is not a correctness bug, this would have resulted in a persist/flush after every mutation if enough invalid operations had accumulated.
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