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

Ssubscribe not honoring read_from_replicas flag #3266

Open
thx123 opened this issue Jun 5, 2024 · 0 comments
Open

Ssubscribe not honoring read_from_replicas flag #3266

thx123 opened this issue Jun 5, 2024 · 0 comments

Comments

@thx123
Copy link

thx123 commented Jun 5, 2024

Thanks for wanting to report an issue you've found in redis-py. Please delete this text and fill in the template below.
It is of course not always possible to reduce your code to a small test case, but it's highly appreciated to have as much data as possible. Thank you!

Version: 5.0.4

Platform: Python 3.9 on Macbook Pro running Sonoma 14.5 (23F79) (applies to other platforms as well)

Description: Sharded subscribe is not honoring the read_from_replicas flag for the class RedisCluster. In particular, it's calling:

node = self.cluster.get_node_from_key(s_channel)

which has the following signature:

    def get_node_from_key(self, key, replica=False):
        """
        Get the node that holds the key's slot.
        If replica set to True but the slot doesn't have any replicas, None is
        returned.
        """

As such, only primary replicas are used for sharded subscribe. It'd be great if ssubscribe behaves in the same way as subscribe to be consistent with the definition of the read_from_replicas flag. Thanks!

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

No branches or pull requests

1 participant