Vector DB returns stale document IDs after background compaction and shard reallocation — RAG assistant cites deleted passages
Environment
Self-hosted vector database cluster with 3 data nodes and 1 coordinator. Daily background compaction and shard rebalancing run during low-traffic windows. Application reads vectors via a RAG pipeline; writes and deletes happen continuously. Recent incremental compaction followed by shard moves correlated with responses returning IDs pointing to documents that were deleted days ago.
Symptoms
RAG queries return high-similarity hits that reference deleted documents or passages; retrieved passages do not exist in the current document store. Document IDs in search results sometimes refer to removed content, causing wrong citations and user-visible incorrect answers.
Observations
Cluster logs show compaction and segment merges completed successfully; metadata service reported successful shard reassignments. Attempts to re-run a metadata-only sync returned no errors. A forced reindex of a small subset regenerated correct vectors and removed stale IDs for that set. No explicit errors reported in write path, but occasional 'segment index mismatch' messages appeared in compaction logs around the time of rebalancing.
Already attempted
Restarted coordinator and data nodes, re-ran compaction on affected shards, attempted metadata sync script, performed a targeted reindex for a subset which corrected results for that subset but not the entire corpus.
Question
What diagnostic checks confirm whether stale IDs are due to a compaction metadata bug, caching layer mismatch, or incomplete delete tombstone application? What's the safest recovery path to restore consistency with minimal downtime?
Verified community troubleshooting
Stop ingest temporarily and export cluster metadata to prevent further divergence. Run the DB's integrity/verify tool (or the compaction dry-run) to see if tombstones were applied; check compaction logs for skipped deletes. If verification flags inconsistent segments, the safest route is a controlled rebuild: snapshot current index, reindex from the source documents into a new index, switch the read alias when verified, and keep the old index until you confirm results. This is reversible: you can point traffic back to the old index while investigating. Long-term, enable stronger write quorum and alerting on compaction failures.
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags
- Artificial Intelligence47% match
Vector DB returns deleted documents and stale IDs after nightly compaction and shard rebalance
Solved1 answer - Artificial Intelligence42% match
Incremental vector index job creates duplicate vector IDs and stale text pointers — RAG assistant returns deleted passages
Open0 answers - Artificial Intelligence41% match
Semantic search returns high-similarity but irrelevant results after nightly vector DB compaction and shard rebalancing
Open0 answers - Artificial Intelligence39% match
Incremental vector index job leaves stale vectors and duplicate document IDs — RAG answers cite deleted passages
Open0 answers - Artificial Intelligence37% match
Dense vector index returns stale document IDs and wrong passages after incremental update job — RAG answers become semantically irrelevant
Open0 answers