LightRAG/lightrag
BukeLy e24b2ed4fa fix: Prioritize workspace-specific legacy collections in Qdrant migration
Why this change is needed:
The E2E test test_backward_compat_old_workspace_naming_qdrant was failing
because _find_legacy_collection() searched for generic "lightrag_vdb_{namespace}"
before workspace-specific "{workspace}_{namespace}" collections. When both
existed, it would always find the generic one first (which might be empty),
ignoring the workspace collection that actually contained the data to migrate.

How it solves it:
Reordered the candidates list in _find_legacy_collection() to prioritize
more specific naming patterns over generic ones:
  1. {workspace}_{namespace}  (most specific, old workspace format)
  2. lightrag_vdb_{namespace}  (generic legacy format)
  3. {namespace}  (most generic, oldest format)

This ensures the migration finds the correct source collection with actual data.

Impact:
- Fixes test_backward_compat_old_workspace_naming_qdrant which creates
  a "prod_chunks" collection with 10 points
- Migration will now correctly find and migrate from workspace-specific
  legacy collections before falling back to generic collections
- Maintains backward compatibility with all legacy naming patterns

Testing:
Run: pytest tests/test_e2e_multi_instance.py::test_backward_compat_old_workspace_naming_qdrant -v
2025-11-20 02:34:55 +08:00
..
api Bump API version to 0256 2025-11-18 23:15:31 +08:00
evaluation Update LLM cache migration docs and improve UX prompts 2025-11-08 23:48:19 +08:00
kg fix: Prioritize workspace-specific legacy collections in Qdrant migration 2025-11-20 02:34:55 +08:00
llm Improve Bedrock error handling with retry logic and custom exceptions 2025-11-17 12:54:32 +08:00
tools Improve LightRAG initialization checker tool with better usage docs 2025-11-17 15:42:54 +08:00
__init__.py Bump core version to 1.4.9.9 and API to 0252 2025-11-08 11:27:26 +08:00
base.py style: fix lint issues (trailing whitespace and formatting) 2025-11-20 01:28:39 +08:00
constants.py Refactor entity merging with unified attribute merge function 2025-10-27 00:04:17 +08:00
exceptions.py Auto-initialize pipeline status in LightRAG.initialize_storages() 2025-11-17 12:54:33 +08:00
lightrag.py style: fix lint issues (trailing whitespace and formatting) 2025-11-20 01:28:39 +08:00
namespace.py Add entity/relation chunk tracking with configurable source ID limits 2025-10-20 15:24:15 +08:00
operate.py Adjust chunking parameters to match the default environment variable settings 2025-11-18 23:14:50 +08:00
prompt.py Fix typo in 'equipment' in prompt.py 2025-10-22 11:13:22 +08:00
rerank.py
types.py
utils.py style: fix lint issues (trailing whitespace and formatting) 2025-11-20 01:28:39 +08:00
utils_graph.py Improve entity merge logging by removing redundant message and fixing typo 2025-10-31 17:16:59 +08:00