Fix VREM of disk-evicted Vector Set element spuriously reporting not-found#1961
Draft
tiagonapoli wants to merge 3 commits into
Draft
Fix VREM of disk-evicted Vector Set element spuriously reporting not-found#1961tiagonapoli wants to merge 3 commits into
tiagonapoli wants to merge 3 commits into
Conversation
…found The DiskANN delete callback (DeleteCallbackUnmanaged) gated its return on status.Found. Tsavorite deletes are tombstone appends that never read the old record back, so for a record already flushed to disk status.Found is false even though the key logically exists. That made the callback return 0, Service.Remove return false, TryRemove report MissingElement, and VREM answer :0 (silently, with no error) for any element that had been evicted to disk. Return success on status.IsCompletedSuccessfully, matching the sibling Write/RMW callbacks. Adds two layered regression tests: an end-to-end VREM-over-RESP test and a lower-level test that drives VectorManager.TryRemove/Service.Remove directly, both forcing the element to disk via Log.FlushAndEvict first. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1030a670-b85f-41bb-b225-e2ddef5535eb
Drop the SeedVectorSetAndFlushToDisk helper in favor of three hardcoded VADD VALUES calls plus an inline FlushAndEvict per test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1030a670-b85f-41bb-b225-e2ddef5535eb
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1030a670-b85f-41bb-b225-e2ddef5535eb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
VREMof a Vector Set element silently reported "not removed" (:0, no error) whenever that element's records had been evicted to disk.The DiskANN delete callback (
VectorManager.DeleteCallbackUnmanaged) gated its return value onstatus.Found. Tsavorite deletes are tombstone appends and never read the old record back, so for a disk-resident recordstatus.Found == falseeven though the key logically exists. The failing0then propagated:DeleteCallbackUnmanagedreturns0→ nativeremove!= 1 →DiskANNService.Removefalse→VectorManager.TryRemove->MissingElement→NetworkVREMwrites:0.The client could not distinguish this from "element was never there" — a data-correctness bug with no exception.
Fix
Return success on
status.IsCompletedSuccessfully(dropping the&& status.Found), matching the siblingWrite/RMWcallbacks which already only checkIsCompletedSuccessfully.Tests
Two layered regression tests, both forcing every record to disk via
Log.FlushAndEvictfirst:VREMOnDiskFlushedElementSucceeds— end-to-end over RESP: assertsVREMreturns1, a repeat returns0, and aVSIMconsistency check.VREMOnDiskFlushedElement_ServiceRemoveSucceeds— lower-level: drivesVectorManager.TryRemove→DiskANNService.Removedirectly (bypassing RESP parsing/encoding and AOF replication), assertingVectorManagerResult.OK.Verified before/after by toggling the fix:
VREM)1Expected: 1, But was: 0Service.Remove(TryRemove)OKExpected: OK, But was: MissingElement