fix(falkordb): route grouped clears to tenant graphs - #1703
Open
d3f4w2 wants to merge 1 commit into
Open
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA behalf on myself, e-mail: liujiahuishen@gmail.com |
Author
|
I have read the CLA Document and I hereby sign the CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix FalkorDB group-scoped clearing so MCP
clear_graphdeletes the requested tenant graphs instead of filtering the base/default graph and reporting a false success.FalkorDB stores each
group_idin a separate physical graph.FalkorGraphMaintenanceOperations.clear_datapreviously executed property-filtered deletes on the executor's current graph, which is normallydefault_db. The fix clones the driver per requested group, clears that physical graph, and preserves the existing transaction-like fallback for executors that cannot be cloned.Duplicate group IDs are de-duplicated while preserving order, and groups are cleared sequentially to avoid concurrent operations on the shared FalkorDB connection.
Type of Change
Objective
Restore the destructive-operation contract for FalkorDB multi-tenant deployments: a successful group-scoped clear must actually remove data from every requested group graph.
This is the remaining
clear_graphportion of #1651 after #1670 and #1675 fixed the corresponding read paths. UUID-only lookup/delete tools are intentionally out of scope because their cross-graph lookup contract needs separate design.Testing
Validated locally:
uv run pytest tests/driver/test_falkordb_ops_routing.py -q— 8 passeduv run ruff check— passeduv run pyright ./graphiti_core— 0 errorsuv run ruff format --checkandgit diff --check— passedNew unit coverage verifies single-group routing, multi-group routing, duplicate group IDs, and clearing the current graph when no group scope is supplied. The tests use
GraphDrivermocks and do not require a live FalkorDB.Breaking Changes
Checklist
make lintequivalent commands pass)Related Issues
Addresses the
clear_graphpath in #1651.