redis / redis-om-python

Object mapping, and more, for Redis and Python
MIT License
1.06k stars 108 forks source link

fix: Migrator throws `Moved` error when connecting to cluster #550

Open a9raag opened 11 months ago

a9raag commented 11 months ago

While connecting to a Redis Cluster Migrator run fails to create_index since the commands are executed using a Redis connection. In this scenario, there should be some way to distinguish between Redis and RedisCluster in order to avoid:

redis.exceptions.MovedError: 13099 as mentioned in #408 #412 With RedisCluster support there would be an option to execute these commands on primary nodes and we won't run into the MovedError

In this PR: We can connect with RedisCluster using two ways:

This resolves #408 and resolves #412

a9raag commented 11 months ago

Hi @chayim @simonprickett, can you guys please take a look at this?

simonprickett commented 11 months ago

Adding @dvora-h

a9raag commented 11 months ago

We are planning to use redis-om in production and waiting for this fix. Any input will be appreciated @dvora-h Thanks :)

XChikuX commented 10 months ago

@chayim @dvora-h I'd love this checked in. If you have the time.