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

Add dynamic_startup_nodes parameter to async ValkeyCluster #167

Conversation

Kakadus
Copy link
Contributor

@Kakadus Kakadus commented Jan 10, 2025

Pull Request check-list

  • Do tests and lints pass with this change?
  • 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)?

Description of change

Note: I opened this PR some time ago at redis-py, but there seems to be no responses so far. It fixes a bug we currently have with redis-py, and we will migrate to valkey-py if this get accepted here : )

The async version of the ValkeyCluster lackes 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 redis/redis-py#2472, which describes the problem in detail.

@Kakadus Kakadus force-pushed the 2472redis-add-dynamic-startup-nodes-flag-to-async-valkey-cluster branch from 5d4f019 to e6a2369 Compare January 10, 2025 15:27
@mkmkme mkmkme self-assigned this Jan 10, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.24%. Comparing base (e0151c1) to head (4be949a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #167   +/-   ##
=======================================
  Coverage   76.23%   76.24%           
=======================================
  Files         130      130           
  Lines       33946    33956   +10     
=======================================
+ Hits        25880    25891   +11     
+ Misses       8066     8065    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mkmkme mkmkme added the feature label Jan 13, 2025
Copy link
Collaborator

@mkmkme mkmkme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Kakadus,

Thanks for your contribution! The change looks good to me. Even though it changes the default user-facing behaviour I suppose it should be fine since it shouldn't break any existing setup. I'll still wait for other maintainers to hear from them about it.

@mkmkme
Copy link
Collaborator

mkmkme commented Jan 13, 2025

Also one request: would you be able to change your user.email git config to an actual e-mail instead of one @users.noreply.github.com?

@Kakadus
Copy link
Contributor Author

Kakadus commented Jan 13, 2025

Even though it changes the default user-facing behaviour I suppose it should be fine since it shouldn't break any existing setup. I'll still wait for other maintainers to hear from them about it.

It really shouldn't? By default, dynamic_startup_nodes is true, so the exact same code (self.set_nodes(...)) should be executed. Old code without this parameter don't see any behavior change.

  • Thanks for the nice response btw

Signed-off-by: Jonas Dittrich <kakadus2303@gmail.com>
@Kakadus Kakadus force-pushed the 2472redis-add-dynamic-startup-nodes-flag-to-async-valkey-cluster branch from e6a2369 to 4be949a Compare January 13, 2025 10:17
Copy link
Member

@aiven-sal aiven-sal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@mkmkme mkmkme enabled auto-merge January 13, 2025 15:08
@mkmkme
Copy link
Collaborator

mkmkme commented Jan 13, 2025

Great, thank you for fixing the DCO! I have put this PR into the merge queue. This change will be a part of upcoming 6.1.0 :)

@mkmkme mkmkme merged commit bcd5e2c into valkey-io:main Jan 13, 2025
93 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

async redis cluster should use initial startup nodes during reinitialization in case of failover
4 participants