You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to create a index the response is b'OK', but you can see that there was an error. Here my IPython logs:
In [2]: r.ft('foo').create_index([TextField('bar')])
MovedError
Traceback (most recent call last):
File "path/venv/lib/python3.10/site-packages/redis/cluster.py", line 1074, in _execute_command
response = redis_node.parse_response(connection, command, **kwargs)
File "path/venv/lib/python3.10/site-packages/redis/client.py", line 1254, in parse_response
response = connection.read_response()
File "path/venv/lib/python3.10/site-packages/redis/connection.py", line 839, in read_response
raise response
redis.exceptions.MovedError: 12182 127.0.0.1:7002
Out[2]: b'OK'
When I run r.ft('foo').create_index([TextField('bar')]) again I get:
...
ResponseError: Index already exists
So probably the first try worked as expected, but only prints an error.
By looking into the code I think that these two lines of RedisCluster._determine_nodes are causeing the issue because they always use the default node and not the node of slot of the index name:
When I removed these lines the error was gone, but I think the lines have to be there for a reason.
I while looking into the code I also saw, that Search.pipeline always (for clusters and single servers) returns a redis.commands.search.Pipeline object, which does not inharit ClusterPipeline.
Because of this r.ft('foo').pipeline() fails. Because Search.sugadd uses this function, r.ft('foo').sugadd('bar') fails as well.
The text was updated successfully, but these errors were encountered:
Version: 4.3.4
Platform: Python 3.10.6 on Archlinux with
5.19.5-arch1-1
kernelDescription:
Dockerfile
For the redis cluster I use a docker image build from the Dockerfile and start it with:
Setup:
When I try to create a index the response is
b'OK'
, but you can see that there was an error. Here my IPython logs:When I run
r.ft('foo').create_index([TextField('bar')])
again I get:So probably the first try worked as expected, but only prints an error.
By looking into the code I think that these two lines of
RedisCluster._determine_nodes
are causeing the issue because they always use the default node and not the node of slot of the index name:redis-py/redis/cluster.py
Lines 836 to 837 in e6cd4fd
When I removed these lines the error was gone, but I think the lines have to be there for a reason.
I while looking into the code I also saw, that
Search.pipeline
always (for clusters and single servers) returns aredis.commands.search.Pipeline
object, which does not inharitClusterPipeline
.Because of this
r.ft('foo').pipeline()
fails. BecauseSearch.sugadd
uses this function,r.ft('foo').sugadd('bar')
fails as well.The text was updated successfully, but these errors were encountered: