LightRAG/lightrag
BukeLy f7b500bca2 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
(cherry picked from commit eb52ec94d7)
2025-12-04 19:11:16 +08:00
..
api feat: Add workspace isolation support for pipeline status 2025-12-04 19:11:16 +08:00
evaluation feat(evaluation): Add sample documents for reproducible RAGAS testing 2025-12-04 19:11:09 +08:00
kg feat: Add workspace isolation support for pipeline status 2025-12-04 19:11:16 +08:00
llm Refactor keyword_extraction from kwargs to explicit parameter 2025-12-04 19:11:09 +08:00
models tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
services tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
tools Improve LightRAG initialization checker tool with better usage docs 2025-12-04 19:09:05 +08:00
__init__.py Bump core version to 1.4.9.1 2025-09-28 15:25:02 +08:00
base.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
constants.py fix: sync core modules with upstream for compatibility 2025-12-04 19:10:46 +08:00
exceptions.py Add Qdrant legacy collection migration with workspace support 2025-12-04 19:11:15 +08:00
lightrag.py feat: Add workspace isolation support for pipeline status 2025-12-04 19:11:16 +08:00
namespace.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
operate.py Improve error handling and add cancellation checks in pipeline 2025-12-04 19:11:15 +08:00
prompt.py Improve prompt clarity by standardizing terminology and formatting 2025-09-28 13:31:55 +08:00
rerank.py Fix trailing whitespace and update test mocking for rerank module 2025-12-04 19:11:14 +08:00
security.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
tenant_rag_manager.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
types.py
utils.py Remove ascii_colors dependency and fix stream handling errors 2025-12-04 19:11:13 +08:00
utils_context.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
utils_graph.py Improve entity merge logging by removing redundant message and fixing typo 2025-12-04 19:09:02 +08:00