Nordix / hiredis-cluster

C client library for Valkey/Redis Cluster. This project is used and sponsored by Ericsson. It is a fork of the now unmaintained hiredis-vip.
BSD 3-Clause "New" or "Revised" License
86 stars 42 forks source link

Update the slotmap after send errors/timeouts in the sync API #178

Closed bjosv closed 1 year ago

bjosv commented 1 year ago

When redis_cluster_command_execute() fails to send a command, or get a reply due to context errors like timeouts, we should update the slotmap in some way. It might be problematic to perform this update in the same blocking call, specially if the slotmap update also timeout. The user of the API maybe dont want this additional waiting time in a call.

One option could be to set cc->need_update_route and then at next send attempt we update the slotmap in parallel (unless the user already has manually updated the slotmap?).

zuiderkwast commented 1 year ago

This is needed if a failover has happened and we try to send a command to the node which is gone. We need to use a different node to fetch the updated slot mapping.

Some more ideas: