Why this change is needed:
The legacy_namespace logic was incorrectly including workspace in the
collection name, causing migration to fail in E2E tests. When workspace
was set (e.g., to a temp directory path), legacy_namespace became
"/tmp/xxx_chunks" instead of "lightrag_vdb_chunks", so the migration
logic couldn't find the legacy collection.
How it solves it:
Changed legacy_namespace to always use the old naming scheme without
workspace prefix: "lightrag_vdb_{namespace}". This matches the actual
collection names from pre-migration code and aligns with PostgreSQL's
approach where legacy_table_name = base_table (without workspace).
Impact:
- Qdrant legacy data migration now works correctly in E2E tests
- All unit tests pass (6/6 for both Qdrant and PostgreSQL)
- E2E test_legacy_migration_qdrant should now pass
Testing:
- Unit tests: pytest tests/test_qdrant_migration.py -v (6/6 passed)
- Unit tests: pytest tests/test_postgres_migration.py -v (6/6 passed)
- Updated test_qdrant_collection_naming to verify new legacy_namespace
|
||
|---|---|---|
| .. | ||
| conftest.py | ||
| README_WORKSPACE_ISOLATION_TESTS.md | ||
| test_aquery_data_endpoint.py | ||
| test_base_storage_integrity.py | ||
| test_curl_aquery_data.sh | ||
| test_e2e_multi_instance.py | ||
| test_embedding_func.py | ||
| test_graph_storage.py | ||
| test_lightrag_ollama_chat.py | ||
| test_postgres_migration.py | ||
| test_postgres_retry_integration.py | ||
| test_qdrant_migration.py | ||
| test_workspace_isolation.py | ||
| test_write_json_optimization.py | ||