Giter Club home page Giter Club logo

Comments (4)

bjosv avatar bjosv commented on June 26, 2024 1

But we definitely want it to perform a rediscovery so that it recovers and starts sending the command to a valid node present in the cluster.

Sounds reasonable. I'll look into it..unless you are preparing a PR already?

from hiredis-cluster.

rahulKrishnaM avatar rahulKrishnaM commented on June 26, 2024 1

Thanks, please go ahead @bjosv :)

from hiredis-cluster.

bjosv avatar bjosv commented on June 26, 2024

Ah..
The ..ToNode() were introduced as a low level API primarily to be able to send commands that are not slot bound,
and this was the reason for not performing retires and redirect as stated in the README. Are you sending commands without keys in your case?

I have seen usage of cluster_update_route() to manually handle cluster rediscovery in this case, but maybe it's not perfect..not after the recent changes which introduces async slotmap updates.

Would you need to have the command resent, or would it be enough if hiredis-cluster internally triggers a rediscovery so that the slotmap gets updated for future commands?
I guess resending commands might be a problem since we are not really sure if the redis server has handled the command or not. It depends on error and what command is sent, e.g. we don't want to resend a INCR command for example.

from hiredis-cluster.

rahulKrishnaM avatar rahulKrishnaM commented on June 26, 2024

Hi @bjosv Thanks for the detail.

We have a use case where we are relying on the ..ToNode() api to send the same command to all the master nodes that are present in the cluster combine the responses from individual nodes and sent back the response to application.

So, we invoke an initNodeIterator() to get the iterator begin, followed by redisClusterAsyncCommandArgvToNode() for the iterator object, till iterator becomes invalid in a while loop.

The issue we are facing is that, as soon a redis master server node is deleted, it still attempts to send the command to the stale IP and gives back timeout response. So, we are never able to respond back with success to the application.

Are you sending commands without keys in your case?

The command has keys in it, and the command structure is similar to how we pass data to redisClusterAsyncCommandArgv() api.

Would you need to have the command resent, or would it be enough if hiredis-cluster internally triggers a rediscovery so that the slotmap gets updated for future commands?

Since the master node has gone down, I guess it's fine to see 1 or 2 timeout responses since the hiredis nodes table takes a while to get updated. But we definitely want it to perform a rediscovery so that it recovers and starts sending the command to a valid node present in the cluster. Making it as closer to redisClusterAsyncCommandArgv() behaviour would be ideal I would say since end user need not worry of handling the command/response differently in both cases.

from hiredis-cluster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.