vert-x3 / vertx-redis-client

Redis client for Vert.x
http://vertx.io
Apache License 2.0
131 stars 119 forks source link

Cluster mode (MOVED Exception) #372

Closed OmerShemesh closed 3 months ago

OmerShemesh commented 1 year ago

Questions

I'm using the RedisClusterClient which communicates with AWS elasticache cluster with 3 shards + 1 replica per shard. While trying to write json value I'm getting this error:

 ERROR [com.del.san.SanityCheckLambda] (vert.x-eventloop-thread-1) MOVED 5776 x.x.x.x:6379

Version

Which version(s) did you encounter this bug ?

4.3.7

pmlopes commented 1 year ago

Hi @OmerShemesh we don't have access to an AWS cluster, can you create a reproducer with TestContainers?

pdkgamage commented 1 year ago

I am facing this same issue. using following dependency `

io.vertx
  <artifactId>vertx-redis-client</artifactId>
  <version>4.4.4</version>
</dependency>`

Any solution or workaround for this issue?

Ladicek commented 1 year ago

Do you maybe use Command.create(String) to create an instance of command that is sent to the Redis cluster? I accidentally found out that we were doing that in Quarkus and it often results in MOVED redirects because the created Command is not key-aware and hence selecting the correct endpoint doesn't work correctly. That will be fixed (#413, #414), but until then, you should use the existing static instances of commands in Command.

If you're not doing that, please ignore the previous paragraph. Does that happen during cluster resharding? For some reason, the Vert.x Redis client automatically handles the ASKED redirect, but not MOVED. I'm not sure why, but there must have been a reason. You can retry the command manually and the client should obtain the new cluster topology and route the command correctly.

If that's not a resharding situation either, could you please upload a reproducer somewhere?