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

Redis standalone #822

Open
wants to merge 56 commits into
base: develop
Choose a base branch
from

Conversation

ae-ignatiev
Copy link

@ae-ignatiev ae-ignatiev commented Jan 7, 2025

Redis standalone implementation.

  • New sharding_strategy RedisStandalone
  • New implementation class StandaloneImpl of interface SentinelImplBase. Based on cluster topology implementation without nodes discovery and single ClusterShard shard instance only.
  • Subscribers adopted to construct correct implementation
  • Added pytest plugin redis_standalone to run single redis instance. Plugin use the same approach and configs as in ya testsuite plugins to run redis and redis cluster: https://github.com/yandex/yandex-taxi-testsuite/tree/develop/testsuite/databases/redis
  • Functional test pubsub
  • Functional test integration_tests that was not used. Use testcase there to run standalone version. Tests for cluster fail there, marked them as failing cases for now.

Note: by creating a PR or an issue you automatically agree to the CLA. See CONTRIBUTING.md. Feel free to remove this note, the agreement holds.

@ae-ignatiev
Copy link
Author

@VyacheslavVanin , hi!

Could you please take a look at updates? Is that approach you've mentioned?
There are standalone_topology_holder.{hpp,cpp} and topology_holder_base.hpp.

There is a doubt regarding method implementation SetConnectionInfo. As I understood calling this method and changing the connection params causes updating the nodes set and topology.

Do not know whether it is applicable for a single node configuration or not. With empty method SetConnectionInfo implementation is easier but nodes configuration is completely static and can't be changed in runtime.

std::tie(conn_to_create_.host, conn_to_create_.port) = new_conn.HostPort();
conn_to_create_.connection_security = new_conn.GetConnectionSecurity();
conn_to_create_.read_only = new_conn.IsReadOnly();
// conn_to_create_.password = ???
Copy link

@VyacheslavVanin VyacheslavVanin Jan 17, 2025

Choose a reason for hiding this comment

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

Can we change type of conn_to_create_ to ConnectionInfoInt and just copy new_conn there?
It seems like there will be less conversions.

We will update password later. Let it be as is

Copy link
Author

Choose a reason for hiding this comment

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

Changed

@VyacheslavVanin
Copy link

VyacheslavVanin commented Jan 21, 2025

@VyacheslavVanin , hi!

There is a doubt regarding method implementation SetConnectionInfo. As I understood calling this method and changing the connection params causes updating the nodes set and topology.

Do not know whether it is applicable for a single node configuration or not. With empty method SetConnectionInfo implementation is easier but nodes configuration is completely static and can't be changed in runtime.

@ae-ignatiev, hi!

This method is called when secdist updates. And secdist contains hosts, ports and password, so it is applicable.

I think we can leave password unchanged in SetConnectionInfo. We will fix this later

Copy link

@VyacheslavVanin VyacheslavVanin left a comment

Choose a reason for hiding this comment

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

looks good to me

vitek pushed a commit to yandex/yandex-taxi-testsuite that referenced this pull request Feb 14, 2025
Added pytest redis_standalone to run single redis instance. Plugin uses the same approach and configs as in ya testsuite plugins to run redis and redis cluster: https://github.com/yandex/yandex-taxi-testsuite/tree/develop/testsuite/databases/redis

Cherry-pick some of the changes from userver-framework/userver#822 and move them into testsuite

Co-authored-by: Aleksey Ignatiev <[email protected]>
@apolukhin
Copy link
Member

We encountered issues in our internal build infrastructure while merging this PR. Working towards fixing the issues. Will merge the PR soon after that.

Many thanks for the PR!

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.

4 participants