FULL AI ANALYSIS

Semantic search returns high-similarity but irrelevant results after nightly vector DB compaction and shard rebalancing

Generated Oct 17, 2026, 9:26:11 AM

Analysis summary

The fact that full reindex fixes results and that exported vectors change mapping after compaction strongly indicates metadata corruption or an ID remap bug during segment merge/rebalance. Likely causes include a bug in compaction logic that doesn't preserve mapping from vector slots to document IDs, an out‑of‑sync metadata store (e.g., segment manifest) used to resolve IDs after moves, or the index storage layer reusing vector slots without updating the ID->vector mapping. Less likely but possible are mismatched embedding pipeline versions causing semantic drift (wouldn't produce wrong IDs), or storage corruption.

Possible causes

Compaction/merge/rebalance routine bug that fails to preserve vector→document-ID mapping when moving vectors between segments or shards

75%

Inconsistent or stale cluster metadata (segment manifests) during rebalancing causing nodes to resolve wrong doc IDs for vector slots

60%

Embedding model/version change without reindex leading to semantic mismatch (high similarity but to wrong passages unlikely but possible if IDs shifted)

30%

Storage-layer corruption or race while writing segment files under heavy disk IO during compaction

25%

Suggested fixes

1

Diagnostic step 1

Before running compaction on production, snapshot the cluster metadata (segment manifests, shard allocation maps) and a small sample of vectors and their document IDs so you can compare pre/post mappings.

2

Diagnostic step 2

Run a controlled compaction on a staging copy of the collection and compare the exported (vector,docID) pairs before and after compaction to detect remapping; do not expose document content externally — use hashed IDs and vector dumps.

3

Diagnostic step 3

Enable (or increase) compaction/rebalance logging to capture detailed segment move/merge operations and any warnings; collect logs for the compaction window and preserve timestamps.

4

Diagnostic step 4

If possible, upgrade to the latest patch of the vector DB (with vendor guidance) in a staging environment, or apply a vendor-provided hotfix that addresses compaction metadata handling. If tests reproduce the ID remap, escalate to the vector DB vendor with the pre/post manifest and vector dump.

5

Diagnostic step 5

As a short-term mitigation, schedule full reindexes during low-traffic windows, and consider disabling automatic compaction/rebalance until root cause established. Reindexing can be I/O heavy — ensure backups and snapshots are taken beforehand. If internal expertise insufficient, escalate to vendor support with logs and manifest snapshots.