-
Notifications
You must be signed in to change notification settings - Fork 11
Support Redis Cluster #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for Redis Cluster by detecting cluster mode, adding key hash tagging for key grouping, and ensuring that Redis pipelines run with transaction disabled in cluster mode.
- Detect cluster mode on client initialization
- Integrate key hashing via get_key_with_hash_tag
- Adjust pipeline creation to use transaction=not cluster_mode for TTL and search operations
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
tests/test_cluster_mode.py | Introduces tests for sync cluster detection, key hash tagging, and pipeline transaction setting |
tests/test_async_cluster_mode.py | Introduces tests for async cluster detection and key hash tagging with appropriate pipeline behavior |
langgraph/store/redis/base.py | Adds get_key_with_hash_tag function and detects cluster mode in init with corresponding pipeline adjustments |
langgraph/store/redis/aio.py | Updates async pipeline creation to use cluster mode flag in TTL and search operations |
langgraph/store/redis/init.py | Adapts synchronous store operations to handle key hash tagging and pipeline configuration for cluster mode |
Comments suppressed due to low confidence (1)
langgraph/store/redis/aio.py:213
- [nitpick] In the vector search branch, the pipeline is created with a fixed transaction=False. For consistency with other usage (i.e. transaction=not self.cluster_mode), consider aligning this parameter to improve maintainability.
pipeline = self._redis.pipeline(transaction=False)
Add support for Redis Cluster/Redis Enterprise:
transaction=False
when running pipelines.