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

cluster - scan do not respect require_full_coverage at false #3411

Open
raphaelauv opened this issue Oct 11, 2024 · 0 comments
Open

cluster - scan do not respect require_full_coverage at false #3411

raphaelauv opened this issue Oct 11, 2024 · 0 comments

Comments

@raphaelauv
Copy link

Version: 5.1.1

Platform: python 3.11

Description:

when I run a scan ( with scan_iter helper ) on a redis cluster with require_full_coverage at false

and a node is missing then the scan command fail

  File "/home/raphael/REPO/xx/src/redis_clean.py", line 27, in main
    keys_to_delete = [x for x in r_client.scan_iter(match_regex, 100)]
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/raphael/REPO/xx/src/redis_clean.py", line 27, in <listcomp>
    keys_to_delete = [x for x in r_client.scan_iter(match_regex, 100)]
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/raphael/REPO/xx/venv/lib/python3.11/site-packages/redis/commands/cluster.py", line 793, in scan_iter
    cursors, data = self.scan(match=match, count=count, _type=_type, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/raphael/REPO/xx/venv/lib/python3.11/site-packages/redis/commands/core.py", line 3017, in scan
    return self.execute_command("SCAN", *pieces, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/raphael/REPO/xx/venv/lib/python3.11/site-packages/redis/cluster.py", line 1115, in execute_command
    raise e
  File "/home/raphael/REPO/xx/venv/lib/python3.11/site-packages/redis/cluster.py", line 1101, in execute_command
    res[node.name] = self._execute_command(node, *args, **kwargs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/raphael/REPO/xx/venv/lib/python3.11/site-packages/redis/cluster.py", line 1174, in _execute_command
    raise e
  File "/home/raphael/REPO/xx/venv/lib/python3.11/site-packages/redis/cluster.py", line 1144, in _execute_command
    connection = get_connection(redis_node, *args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/raphael/REPO/xx/venv/lib/python3.11/site-packages/redis/cluster.py", line 51, in get_connection
    return redis_node.connection or redis_node.connection_pool.get_connection(
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/raphael/REPO/xx/venv/lib/python3.11/site-packages/redis/connection.py", line 1074, in get_connection
    connection.connect()
  File "/home/raphael/REPO/xx/venv/lib/python3.11/site-packages/redis/connection.py", line 283, in connect
    raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 113 connecting to 172.20.0.4:6379. No route to host.

I would expect the command to run in best effort on available nodes.

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