-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add dynamic_startup_nodes parameter to async RedisCluster #3447
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: master
Are you sure you want to change the base?
Add dynamic_startup_nodes parameter to async RedisCluster #3447
Conversation
c9ca010
to
cce34d7
Compare
cce34d7
to
dd2ee3f
Compare
any news here? this looks good to me |
Hi @Kakadus would you have some time to complete this PR. There are some conflicts with the master branch that need to be resolved. |
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 the "dynamic_startup_nodes" parameter to the async RedisCluster, aligning its behavior with the sync version.
- Introduces a new parameter to enable or disable dynamic DNS resolution for startup nodes.
- Implements handling in both the NodesManager and RedisCluster initialization.
- Adds parameterized tests to verify behavior with both True and False values.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
tests/test_asyncio/test_cluster.py | Adds tests for dynamic startup nodes behavior using parameterized inputs |
redis/asyncio/cluster.py | Updates RedisCluster and NodesManager to support the new dynamic_startup_nodes parameter |
CHANGES | Documents the addition of the dynamic_startup_nodes parameter |
] | ||
startup_nodes = list(rc.nodes_manager.startup_nodes.keys()) | ||
if dynamic_startup_nodes is True: | ||
assert startup_nodes.sort() == discovered_nodes.sort() |
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.
Using list.sort() returns None; please use sorted(startup_nodes) and sorted(discovered_nodes) to correctly compare the lists.
assert startup_nodes.sort() == discovered_nodes.sort() | |
assert sorted(startup_nodes) == sorted(discovered_nodes) |
Copilot uses AI. Check for mistakes.
Pull Request check-list
Description of change
The async version of the RedisCluster lacked the
dynamic_startup_nodes
parameter. This PR adds the parameter to be activated when dynamic DNS endpoints for startup nodes are in use.Enabling
dynamic_startup_nodes
fixes #2472, which describes the problem in detail.#3111 also addresses said issue, but their logic is different to the sync version, while this approach moves the behaviour of the async version closer to the sync version.