[diskann-garnet] Fix cache coherence on set_neighbors#1230
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses a cache-coherency window in diskann-garnet where set_neighbors() updated Garnet storage and the start-point neighbor cache via two separate operations. It aligns set_neighbors() with the existing append_vector() pattern by performing the update via a read-modify-write (RMW) callback, and bumps the crate/package version to reflect the fix.
Changes:
- Update
GarnetProvider::set_neighbors()to useCallbacks::rmw_iid()and update the start-point neighbor cache within the same RMW operation. - Standardize error returns to
GarnetError::Write.into()for write failures in the modified code paths. - Bump
diskann-garnetversion from3.0.0to3.0.1across Rust and NuGet packaging metadata.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| diskann-garnet/src/provider.rs | Switch set_neighbors() to an RMW update to avoid cache/storage coherence windows; minor error return normalization. |
| diskann-garnet/diskann-garnet.nuspec | Bump NuGet package version to 3.0.1. |
| diskann-garnet/Cargo.toml | Bump crate version to 3.0.1. |
| Cargo.lock | Update lockfile entry for diskann-garnet to 3.0.1. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1230 +/- ##
==========================================
+ Coverage 89.64% 89.71% +0.07%
==========================================
Files 503 503
Lines 95761 96009 +248
==========================================
+ Hits 85845 86139 +294
+ Misses 9916 9870 -46
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Could you share before and after perf numbers? Perhaps we should make it easier to run some of these going forward |
When diagnosing some issues last week I realized that there was a cache coherency problem with
set_neighbors().append_vector()updates the start point neighbor cache atomically alongside the real neighbor list, butset_neighbors()did two writes sequentially which could result in coherency issues.As far as I'm aware, this did not cause any actual problems, but it was easy enough to make it coherent by using RMW instead in
set_neighbors().