Repository navigation
Description
Problem
After a restart, an LSM_VECTOR index builds its in-memory location map (vector id -> RID) on first use, in LSMVectorIndex.materializeLocations(). The id allocator (nextId) is then moved past the highest id the load read (syncNextIdWithResidentLocations(), the #6762 fix). The materialisation runs once per process.
If the load stops partway, the pages it never reached still hold higher ids, but the allocator only knows about the ids it read. Every later insert can then mint an id that a live record already owns. Two paths lead there:
- An
Errorduring the load (realistically anOutOfMemoryError, since the first use after a restart happens under full load). The load only catchesException, but thefinallystill runs the sync and latcheslocationsMaterialized = truewith a half-filled map, for the life of the process. - A page the lenient parser cuts short.
LSMVectorIndexPageParser.parsePagescatches the exception per page, logsWARNING "Error parsing page ..."and carries on, so the entries after the failure point are never read.
Effect
Two records end up on one vector id in the persisted pages. A later load gives the id to one of them (or deletes it), and the other record disappears from vector search. CHECK DATABASE (since #8946) reports it as:
N records have a vector id that a load gives to another record or deletes ... (first: #X:Y (mutable, id I lost to #X:Z) ...)
where an older record loses its id to a much newer one, with both on mutable pages. Rebuilding the index repairs it, but the next restart that hits the same condition creates new collisions in other indexes.
Reproduction
Open a database with a populated vector index, make the location map fail after N entries (with an OutOfMemoryError, or an exception on a page), then insert vectors: checkIntegrity() reports records whose id was handed to a newly inserted record.
Proposed fix
- An
Errorduring the load discards the partial map and does not latch it, so the next access loads again from scratch. - A load that could not read every entry (a page cut short, or an
Exceptionpartway) marks the index: it logs SEVERE once and refuses new vectors (IndexException) instead of minting ids that may collide, until the index is rebuilt. checkIntegrity()reports such an index (and any page the parser cut short), soCHECK DATABASElists it andCHECK DATABASE FIXrebuilds it.
Activity
review(#9892): a negative entry count on a damaged page counts as a p…
Merge pull request #9905 from ArcadeData/worktree-arcadedb-9896
lvca commentedon Oct 13, 2026
Fixed in #9905, released in 26.11.1.
On first use after a restart, a vector index reads its pages to learn which vector ids are already taken. If that read stopped partway (most often on an out-of-memory error), the index could hand a new vector an id another record already had, and one of the two records then disappeared from search results.
Now:
SEVEREmessage, andCHECK DATABASElists the index as corrupted. Deletes still work.CHECK DATABASE FIXorREBUILD INDEX <name>to rebuild the index and lift the refusal.❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
fix(ArcadeData#9892): a vector location load that stops partway no lo…
fix(ArcadeData#9896, ArcadeData#9892): vector search honours cancella…
fix(#9892): a vector location load that stops partway no longer lets …
fix(#9896, #9892): vector search honours cancellation and the command…
review(#9892): a negative entry count on a damaged page counts as a p…