fix(vector): address PR review round 4 — backfill resilience + degraded-mode docs

- Remove three stale `# Use numeric file ID` / `# Pass file path` comments
  in scanner.py. file_id is already normalized to str() above each call
  site, so the inline comments mislead readers.
- Wrap `_backfill_doc_id_to_string` scroll loop + sentinel upsert in
  try/except Exception. The qdrant_client singleton is assigned before
  this migration runs, so a transient scroll failure was leaving the
  process holding a usable client with int payloads permanently
  unbackfilled until the next restart. Catch broadly, log ERROR with
  exc_info, and return without writing the sentinel — next process
  restart retries from scratch.
- Note `:memory:` mode behavior near the sentinel constants so future
  readers don't read the every-start scroll as a bug.
- Document the two degraded-migration ERROR log signals in
  docs/configuration.md so operators know when a clean restart is
  required to recover indexing.
- Add unit test asserting scroll-time exceptions are logged and swallowed
  without writing the sentinel.

Closes round-4 review feedback on PR #773.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Chris Coutinho
2026-05-08 23:39:37 +02:00
co-authored by Claude Opus 4.7
parent 02744a50e0
commit b97ac23228
4 changed files with 133 additions and 68 deletions
+17
View File
@@ -355,6 +355,23 @@ Both steps emit INFO-level log lines so operators can track progress.
> caught early. Either widen the public model's `id` field or convert the
> id at the verifier layer.
> **Degraded-migration signals:** both startup steps swallow non-fatal
> failures so the server still starts, but each leaves a distinct ERROR
> log line that operators should treat as a "restart needed" signal:
>
> - `Unexpected error creating payload index on '<field>' (status 5xx)` —
> the index was not created. Searches filtering on that field will keep
> returning HTTP 400 (`Index required but not found`) until a subsequent
> restart succeeds in creating it.
> - `doc_id backfill failed on '<collection>'; will retry on next restart` —
> the migration sentinel was not written. Legacy integer `doc_id`
> payloads remain invisible to the keyword index in the meantime; the
> scroll re-runs from scratch on the next process start.
>
> Neither prevents the server from accepting requests, but both indicate
> that vector search is operating in a degraded state on the affected
> collection until the next clean restart.
#### Explicit Override
Set `QDRANT_COLLECTION` to use a specific collection name: