-
-
Notifications
You must be signed in to change notification settings - Fork 168
impl (core): Implementing RocksDB into the HelixDB core #699
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: dev
Are you sure you want to change the base?
Conversation
… core, vector core
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.
103 files reviewed, 2 comments
Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format
| Ok(db) => Arc::new(db), | ||
| Err(err) => return Err(err), | ||
| }; | ||
| let storage = match HelixGraphStorage::new(opts.path.leak(), opts.config, opts.version_info) |
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.
logic: .leak() causes a memory leak by permanently leaking the String allocation. This prevents the path string from ever being freed.
| let storage = match HelixGraphStorage::new(opts.path.leak(), opts.config, opts.version_info) | |
| let storage = match HelixGraphStorage::new(opts.path.as_str(), opts.config, opts.version_info) |
Prompt To Fix With AI
This is a comment left during a code review.
Path: helix-db/src/helix_engine/traversal_core/mod.rs
Line: 38:38
Comment:
**logic:** `.leak()` causes a memory leak by permanently leaking the `String` allocation. This prevents the path string from ever being freed.
```suggestion
let storage = match HelixGraphStorage::new(opts.path.as_str(), opts.config, opts.version_info)
```
How can I resolve this? If you propose a fix, please make it concise.| /* | ||
| let passes_filters = match filter { | ||
| Some(filter_slice) => filter_slice.iter().all(|f| f(&neighbor, txn)), | ||
| None => true, | ||
| }; | ||
| if passes_filters { | ||
| result.push(neighbor); | ||
| } | ||
| */ |
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.
style: commented-out code should be removed
| /* | |
| let passes_filters = match filter { | |
| Some(filter_slice) => filter_slice.iter().all(|f| f(&neighbor, txn)), | |
| None => true, | |
| }; | |
| if passes_filters { | |
| result.push(neighbor); | |
| } | |
| */ | |
| neighbor.set_distance(neighbor.distance_to(query)?); | |
| if filter.is_none() || filter.unwrap().iter().all(|f| f(&neighbor, txn)) { | |
| result.push(neighbor); | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: helix-db/src/helix_engine/vector_core/rocks/vector_core.rs
Line: 442:451
Comment:
**style:** commented-out code should be removed
```suggestion
neighbor.set_distance(neighbor.distance_to(query)?);
if filter.is_none() || filter.unwrap().iter().all(|f| f(&neighbor, txn)) {
result.push(neighbor);
}
```
How can I resolve this? If you propose a fix, please make it concise.|
Skipped: This PR changes more files than the configured file change limit: ( |
Description
Related Issues
Closes #
Checklist when merging to main
rustfmthelix-cli/Cargo.tomlandhelixdb/Cargo.tomlAdditional Notes
Greptile Summary
Important Files Changed
Sequence Diagram
sequenceDiagram participant User participant HelixGraphEngine participant HelixGraphStorage participant RocksDB participant VectorCore participant HNSW User->>HelixGraphEngine: new(opts) HelixGraphEngine->>HelixGraphStorage: new(path, config, version_info) HelixGraphStorage->>RocksDB: open TransactionDB with column families RocksDB-->>HelixGraphStorage: db instance HelixGraphStorage->>VectorCore: new(db, config) VectorCore-->>HelixGraphStorage: vector core initialized HelixGraphStorage-->>HelixGraphEngine: storage ready HelixGraphEngine-->>User: engine ready User->>HelixGraphEngine: insert vector HelixGraphEngine->>HelixGraphStorage: write_txn() HelixGraphStorage->>RocksDB: transaction() RocksDB-->>HelixGraphStorage: txn HelixGraphStorage->>VectorCore: insert(txn, data) VectorCore->>HNSW: search_level for neighbors HNSW->>RocksDB: get edges from hnsw_edges CF RocksDB-->>HNSW: neighbor data HNSW->>VectorCore: nearest neighbors VectorCore->>RocksDB: put_cf(vectors, vector_data) VectorCore->>RocksDB: merge_cf(hnsw_edges, edge_updates) RocksDB-->>VectorCore: committed VectorCore-->>HelixGraphStorage: vector inserted HelixGraphStorage->>RocksDB: txn.commit() HelixGraphStorage-->>User: success