Skip to content

fix(lancedb): keep FTS migration nonblocking#344

Draft
SiyaoZheng wants to merge 1 commit into
EverMind-AI:mainfrom
SiyaoZheng:fix/lancedb-nonblocking-fts-migration
Draft

fix(lancedb): keep FTS migration nonblocking#344
SiyaoZheng wants to merge 1 commit into
EverMind-AI:mainfrom
SiyaoZheng:fix/lancedb-nonblocking-fts-migration

Conversation

@SiyaoZheng

@SiyaoZheng SiyaoZheng commented Jul 16, 2026

Copy link
Copy Markdown

Summary

Keep the one-time FTS schema migration from performing synchronous marker-file I/O inside its async startup path.

migrate_fts_indexes() previously called pathlib.Path.exists(), read_text(), and write_text() directly. On a slow or busy filesystem these calls block the event loop during service startup. This change wraps the marker in anyio.Path and awaits the file operations while preserving the existing migration/version semantics.

Area

  • Architecture method
  • Benchmark
  • Use case
  • Documentation
  • Developer experience
  • CI, build, or release

Verification

uv run pytest tests/unit/test_core/test_persistence/test_lancedb/test_fts_behavior.py tests/unit/test_core/test_persistence/test_lancedb/test_repository.py -q
44 passed

make ci
1500 unit tests passed; 78 integration tests passed (6 deselected);
lint, architecture contracts, OpenAPI drift, package build, and wheel smoke test passed

Checklist

  • I kept the change scoped to the relevant area.
  • I am opening this from a separate branch, not pushing directly to main.
  • No documentation change is required because the migration contract is unchanged.
  • I added or updated tests when the change affects behavior.
  • I did not commit secrets, .env files, dependency folders, or generated output.
  • Active relative links in Markdown files resolve.

Notes for Reviewers

The tests verify async marker reads and writes for both the migration and already-migrated paths.

By submitting this pull request, I agree that my contribution is licensed under the Apache License 2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant