FULL AI ANALYSIS

Vector DB returns stale document IDs after background compaction and shard reallocation — RAG assistant cites deleted passages

Generated Oct 26, 2026, 9:23:15 AM

Analysis summary

Stale document IDs after compaction and shard moves typically indicate metadata or index mappings that weren't updated during segment merges, or delete tombstones not applied before compaction. Other causes include client-side caches returning old IDs, or a split-brain during reallocation causing duplicate IDs and stale pointers. The partial correction when reindexing a subset suggests the index data can be rebuilt to remove stale entries, pointing to compaction or metadata update issues rather than persistent storage corruption.

Possible causes

Compaction/merge bug that failed to apply delete tombstones to new segments, leaving deleted IDs referenced

85%

Metadata inconsistency after shard reallocation where the coordinator points to outdated segment files on a data node

70%

Client-side or API-layer caching returning stale ID mapping despite server-side deletion

40%

Concurrent writes and deletes with insufficient write-ack/quorum leading to lost tombstones during rebalancing

35%

Suggested fixes

1

Diagnostic step 1

Quiesce writes (put cluster into read-only or pause ingestion) to stop mutation while diagnosing to avoid further inconsistencies.

2

Diagnostic step 2

Export current cluster metadata (shard maps, segment lists, tombstone markers) and snapshot vector segment files before further action.

3

Diagnostic step 3

Run built-in index integrity/check tools (cluster-provided verify/repair) if available and review compaction/merge logs for skipped tombstones or exceptions.

4

Diagnostic step 4

If integrity checks fail or are not available, plan a controlled full reindex from the authoritative document store: schedule off-peak, take snapshots, reindex to a clean index, swap aliases, and keep old index until verification.

5

Diagnostic step 5

Improve operational safeguards: increase write quorum, stagger compaction/rebalance, and raise monitoring/alerting on compaction errors to detect recurrence early.