Semantic search returns high-similarity but irrelevant results after nightly vector DB compaction and shard rebalancing
Environment
Self-hosted vector search cluster (Milvus 2.x-like architecture) behind an indexer pipeline: documents → text normaliser → embedding model v1.3 → insertion into 4 shards; nightly scheduled compaction and shard rebalancing runs between 02:00–03:30. Application queries via gRPC service returning top‑k vectors and document IDs, RAG layer retrieves passage text by ID from primary DB.
Symptoms
After the overnight compaction/rebalance job, production semantic-search queries return top‑k results with very high cosine similarity scores (>0.9) but the retrieved passages are semantically unrelated to the query. Some top results reference document IDs that were previously deleted. The issue persists until a full reindex; a partial reindex or indexer restart does not permanently fix it.
Observations
Compaction logs show segments merged and segment IDs moved between shards; cluster metadata shows segment move operations completed without explicit errors. The document-to-vector mapping table in the primary DB still contains older doc IDs flagged as deleted. A full reindex (recompute embeddings for all active documents and rebuild indexes) restores correct results. No hardware errors reported on the nodes; network and RPC latencies normal during rebalance window.
Already attempted
Restarted vector DB processes, re-ran compaction on a single shard, reloaded node metadata; temporarily disabled nightly rebalance (issue still appears the next night if job runs). Performed partial reindex of affected collections — temporary fix until next compaction. Exported vectors for a small set of documents and ran local similarity checks: exported vectors map to correct docs before compaction and to wrong docs after compaction.
Question
What are the likely root causes that could make segment compaction or shard rebalancing assign vectors to incorrect IDs or leave deleted IDs resolvable by similarity? Which reversible diagnostics can we run to prove whether the bug is in the compaction/rebalance logic, segment metadata store, or index‑to‑document mapping in the application?
Verified community troubleshooting
No answers yet..
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags
- Artificial Intelligence41% match
Vector DB returns deleted documents and stale IDs after nightly compaction and shard rebalance
Solved1 answer - Artificial Intelligence38% match
Vector search returns semantically unrelated high-similarity passages after incremental index update
Open0 answers - Artificial Intelligence37% match
Incremental vector index job creates duplicate vector IDs and stale text pointers — RAG assistant returns deleted passages
Open0 answers - Artificial Intelligence35% match
Dense vector index returns stale document IDs and wrong passages after incremental update job — RAG answers become semantically irrelevant
Open0 answers - Artificial Intelligence34% match
RAG assistant returns high-similarity but irrelevant passages from vector DB on production queries
Open0 answers