You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Vector search errors on deleted indexed node until restart (Community 3.13.1) #4975
Memgraph Community 3.13.1 (latest stable release, 2026-09-14), official memgraph/memgraph OCI index digest sha256:bd3fe13228f40881365486729c78110dde6e04f3c1f102c84720d31f38b693f8; Ubuntu 24.04 x86-64. Storage mode IN_MEMORY_TRANSACTIONAL, WAL enabled. Each scenario used a separate fresh data directory.
Minimal reproduction
Use a 64-dimensional unit vector $a = [1,0,...,0] and run these queries in order:
Expected: the last search returns zero rows. Actual:Trying to get properties from a deleted object. A search against a different vector also raises the same error. A clean process restart makes both searches return zero rows.
Two separate fresh-volume variants also fail immediately after delete: create a new indexed node with a different application ID, or recreate with the same application ID. In each, the original internal ID was 0, a non-indexed sentinel was 1, and the new indexed node had internal ID 2; search for the new vector raised the same error. After clean restart it returned the new node. In-place SET n.embedding=$b without delete worked both immediately and after restart, with a second control vector proving the new embedding ranked first.
Is deletion supposed to remove the vector-index entry synchronously, and is there a supported fix in a released version?
A data point from the same release (3.13.1, memgraph/memgraph@sha256:4710bee1…, IN_MEMORY_TRANSACTIONAL, default config), in case it helps: in my runs the error clears without a restart once the storage garbage collector runs. After MATCH ... DELETE commits, vector_search.search raised Trying to get a property from a deleted object. immediately and 2 s later, but returned the right nodes 35 s later, past the default storage_gc_cycle_sec of 30. Running FREE MEMORY right after the delete clears it at once, which is what my benchmark does after each timed delete for now.
Reproduction, with the neo4j Python driver against a fresh server:
importsys, timefromneo4jimportGraphDatabased=GraphDatabase.driver(f"bolt://{sys.argv[1]}:7687", auth=None)
defsearch(s):
returns.run("CALL vector_search.search('art', 5, [0.0, 0.0]) YIELD node, distance RETURN node.vid AS vid").data()
withd.session() ass:
s.run("UNWIND range(0, 99) AS i CREATE (:Article {vid: i, embedding: [toFloat(i), 0.0]})").consume()
s.run('CREATE VECTOR INDEX art ON :Article(embedding) WITH CONFIG {"dimension": 2, "capacity": 200, "metric": "l2sq", "scalar_kind": "f32"}').consume()
s.run("MATCH (a:Article) WHERE a.vid IN [0, 1, 2] DELETE a").consume()
forlabel, waitin (("immediately", 0), ("after 2 s", 2), ("after 35 s", 33)):
time.sleep(wait)
try: print(label, [r["vid"] forrinsearch(s)])
exceptExceptionase: print(label, "ERROR", e)
Output: immediately ERROR ... deleted object, after 2 s ERROR ..., after 35 s [3, 4, 5, 6, 7]. With FREE MEMORY after the delete instead of waiting, the first search already returns [3, 4, 5, 6, 7].
Thanks a lot for testing this and sharing the GC / FREE MEMORY behavior — that’s very helpful. It strongly suggests the issue is tied to delayed cleanup of deleted vector-index entries rather than persistent index corruption.
We’ll take this into account in our evaluation and will also test the maintenance/GC path explicitly.
Activity
tae898 commentedon Oct 2, 2026
A data point from the same release (3.13.1,
memgraph/memgraph@sha256:4710bee1…,IN_MEMORY_TRANSACTIONAL, default config), in case it helps: in my runs the error clears without a restart once the storage garbage collector runs. AfterMATCH ... DELETEcommits,vector_search.searchraisedTrying to get a property from a deleted object.immediately and 2 s later, but returned the right nodes 35 s later, past the defaultstorage_gc_cycle_secof 30. RunningFREE MEMORYright after the delete clears it at once, which is what my benchmark does after each timed delete for now.Reproduction, with the
neo4jPython driver against a fresh server:Output:
immediately ERROR ... deleted object,after 2 s ERROR ...,after 35 s [3, 4, 5, 6, 7]. WithFREE MEMORYafter the delete instead of waiting, the first search already returns[3, 4, 5, 6, 7].oyatek commentedon Oct 2, 2026
Thanks a lot for testing this and sharing the GC /
FREE MEMORYbehavior — that’s very helpful. It strongly suggests the issue is tied to delayed cleanup of deleted vector-index entries rather than persistent index corruption.We’ll take this into account in our evaluation and will also test the maintenance/GC path explicitly.
benchmarks: the instrument changes for the 26.10.1 re-pin campaign, w…