LightRAG/lightrag/kg
BukeLy eb52ec94d7 feat: Add workspace isolation support for pipeline status
Problem:
In multi-tenant scenarios, different workspaces share a single global
pipeline_status namespace, causing pipelines from different tenants to
block each other, severely impacting concurrent processing performance.

Solution:
- Extended get_namespace_data() to recognize workspace-specific pipeline
  namespaces with pattern "{workspace}:pipeline" (following GraphDB pattern)
- Added workspace parameter to initialize_pipeline_status() for per-tenant
  isolated pipeline namespaces
- Updated all 7 call sites to use workspace-aware locks:
  * lightrag.py: process_document_queue(), aremove_document()
  * document_routes.py: background_delete_documents(), clear_documents(),
    cancel_pipeline(), get_pipeline_status(), delete_documents()

Impact:
- Different workspaces can process documents concurrently without blocking
- Backward compatible: empty workspace defaults to "pipeline_status"
- Maintains fail-fast: uninitialized pipeline raises clear error
- Expected N× performance improvement for N concurrent tenants

Bug fixes:
- Fixed AttributeError by using self.workspace instead of self.global_config
- Fixed pipeline status endpoint to show workspace-specific status
- Fixed delete endpoint to check workspace-specific busy flag

Code changes: 4 files, 141 insertions(+), 28 deletions(-)

Testing: All syntax checks passed, comprehensive workspace isolation tests completed
2025-11-17 12:53:44 +08:00
..
deprecated Preserve ordering in get_by_ids methods across all storage implementations 2025-10-11 12:37:59 +08:00
__init__.py Improve storage config validation and add config.ini fallback support 2025-11-08 22:48:49 +08:00
faiss_impl.py Fix get_by_ids to return None for missing records consistently 2025-10-11 13:34:26 +08:00
json_doc_status_impl.py Add entity/relation chunk tracking with configurable source ID limits 2025-10-20 15:24:15 +08:00
json_kv_impl.py Add entity/relation chunk tracking with configurable source ID limits 2025-10-20 15:24:15 +08:00
memgraph_impl.py Remove unused chunk-based node/edge retrieval methods 2025-11-06 18:17:10 +08:00
milvus_impl.py Remove enable_logging parameter from get_data_init_lock call in MilvusVectorDBStorage 2025-10-29 09:49:59 +08:00
mongo_impl.py Remove unused chunk-based node/edge retrieval methods 2025-11-06 18:17:10 +08:00
nano_vector_db_impl.py Fix vector deletion logging to show actual deleted count 2025-10-27 14:22:16 +08:00
neo4j_impl.py Remove unused chunk-based node/edge retrieval methods 2025-11-06 18:17:10 +08:00
networkx_impl.py Remove unused chunk-based node/edge retrieval methods 2025-11-06 18:17:10 +08:00
postgres_impl.py Fix linting 2025-11-06 20:48:51 +08:00
qdrant_impl.py Add Qdrant legacy collection migration with workspace support 2025-10-30 19:16:33 +08:00
redis_impl.py Fix Redis data migration error 2025-10-21 16:27:04 +08:00
shared_storage.py feat: Add workspace isolation support for pipeline status 2025-11-17 12:53:44 +08:00