fix(falkordb): route single group_id search to the matching graph#1670
Open
Solaris-star wants to merge 2 commits into
Open
fix(falkordb): route single group_id search to the matching graph#1670Solaris-star wants to merge 2 commits into
Solaris-star wants to merge 2 commits into
Conversation
handle_multiple_group_ids only cloned the driver when len(group_ids) > 1. add_episode re-binds self.driver for writes, so a fresh process searching one group_id hit the driver's default database and returned empty results. Clone call-scoped for a single differing group_id as well; do not reassign the shared driver. Fixes getzep#1659
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: 820622658@qq.com |
Contributor
|
@Solaris-star Verified live: single-group retrieve_episodes and search_ returned nothing on main and return correct results with your patch, and the call-scoped clone avoids the shared-state mutation that broke earlier attempts. This supersedes #1326/#1572/#1170 nicely. |
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
On FalkorDB,
add_episodere-bindsself.driverwhengroup_iddiffers from the driver's database, but@handle_multiple_group_idsonly clones whenlen(group_ids) > 1. A single-group_idsearch in a fresh process therefore queries the default graph and silently returns nothing. Adding a second dummy group_id made search work — that was the tell.Change
group_idthat differs fromdriver._database, pass a call-scopeddriver.clone(database=gid)into the wrapped method (no shared-state reassignment)group_idconcurrent clone + merge behaviorTest plan
pytest tests/test_handle_multiple_group_ids.py -q→ 4 passedFixes #1659