Skip to content
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

Added dynamic_startup_nodes configuration to RedisCluster. #2244

Merged
merged 4 commits into from
Jun 23, 2022

Conversation

barshaul
Copy link
Contributor

@barshaul barshaul commented Jun 22, 2022

Pull Request check-list

Please make sure to review and check all of these items:

  • Does $ tox pass with this change (including linting)?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?
  • Was the change added to CHANGES file?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

Added dynamic_startup_nodes configuration to RedisCluster.
By default, when reinitializing the cluster topology, the nodesManager will use only the initial passed startup nodes to refresh the cluster topology. If dynamic_startup_nodes is set to true, the nodesManager will set the startup nodes to all of the discovered nodes and they will be used to determine the cluster nodes-slots mapping in the next topology refresh.

When true, the initial passed startup nodes will be removed if their endpoints aren't listed in the CLUSTER SLOTS output. For example, if dynamic DNS endpoints are used for startup nodes, but CLUSTER SLOTS lists specific IP addresses, the passed startup nodes will be overridden with the specific nodes' IP.
Therefore, it is recommended to keep dynamic_startup_nodes set to false with DNS endpoints.

…, uses only the initial passed startup nodes to refresh the cluster topology. If set to true, sets the startup nodes to all of the discovered nodes.
@codecov-commenter
Copy link

codecov-commenter commented Jun 22, 2022

Codecov Report

Merging #2244 (1ba23fe) into master (6da8086) will decrease coverage by 13.41%.
The diff coverage is 18.18%.

@@             Coverage Diff             @@
##           master    #2244       +/-   ##
===========================================
- Coverage   91.85%   78.44%   -13.42%     
===========================================
  Files         108      108               
  Lines       27776    27786       +10     
===========================================
- Hits        25515    21797     -3718     
- Misses       2261     5989     +3728     
Impacted Files Coverage Δ
redis/cluster.py 19.09% <0.00%> (-71.22%) ⬇️
tests/test_cluster.py 18.58% <25.00%> (-78.49%) ⬇️
tests/test_asyncio/test_cluster.py 18.92% <0.00%> (-78.53%) ⬇️
redis/asyncio/cluster.py 16.92% <0.00%> (-73.00%) ⬇️
redis/asyncio/parser.py 17.30% <0.00%> (-63.47%) ⬇️
redis/commands/cluster.py 32.10% <0.00%> (-62.11%) ⬇️
redis/crc.py 45.45% <0.00%> (-54.55%) ⬇️
redis/utils.py 75.67% <0.00%> (-13.52%) ⬇️
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6da8086...1ba23fe. Read the comment docs.

@barshaul barshaul marked this pull request as ready for review June 22, 2022 14:13
@dvora-h
Copy link
Collaborator

dvora-h commented Jun 23, 2022

@barshaul tests fails after merge master in.

@barshaul
Copy link
Contributor Author

@barshaul tests fails after merge master in.

taking a look.

@dvora-h dvora-h merged commit 63cf7ec into redis:master Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants