-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[ENH]: granular lock for posting list #4937
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
base: 06-18-_enh_more_concurrent_blockfile
Are you sure you want to change the base?
[ENH]: granular lock for posting list #4937
Conversation
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
Implement Granular Locking for Posting List in Spann Index This PR refactors the locking mechanism around the posting list in the Spann index by replacing a coarse-grained global mutex with an Key Changes: Affected Areas: This summary was automatically generated by @propel-code-bot |
@@ -11,6 +11,7 @@ use chroma_blockstore::{ | |||
provider::{BlockfileProvider, CreateError, OpenError}, | |||
BlockfileFlusher, BlockfileReader, BlockfileWriter, BlockfileWriterOptions, | |||
}; | |||
use chroma_cache::AysncPartitionedMutex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[NitPick]
There's a typo in the class name AysncPartitionedMutex
which should be AsyncPartitionedMutex
.
// be changed in future if perf is not satisfactory. | ||
pub posting_list_writer: Arc<tokio::sync::Mutex<BlockfileWriter>>, | ||
pub posting_list_writer: BlockfileWriter, | ||
pub posting_list_partitioned_mutex: Arc<AysncPartitionedMutex<u32>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[BestPractice]
Same typo in the field name - AysncPartitionedMutex
should be AsyncPartitionedMutex
.
@@ -429,7 +429,8 @@ impl SpannIndexWriter { | |||
cleaned_up_hnsw_index: None, | |||
hnsw_provider, | |||
blockfile_provider, | |||
posting_list_writer: Arc::new(tokio::sync::Mutex::new(posting_list_writer)), | |||
posting_list_writer, | |||
posting_list_partitioned_mutex: Arc::new(AysncPartitionedMutex::new(())), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[BestPractice]
Same typo again in the initialization - AysncPartitionedMutex
should be AsyncPartitionedMutex
.
Description of changes
Summarize the changes made by this PR.
Test plan
How are these changes tested?
pytest
for python,yarn test
for js,cargo test
for rustDocumentation Changes
None