Giter VIP home page Giter VIP logo

Comments (2)

mrd0ll4r avatar mrd0ll4r commented on May 23, 2024

Hmm, I've never used redis cluster mode. From reading the docs, this looks suspicious:

Redis Cluster supports multiple key operations as long as all of the keys involved in a single command execution (or whole transaction, or Lua script execution) belong to the same hash slot.

We use MULTI ... EXEC transactions for consistency. We didn't take hash slots into account (didn't even know those existed tbh), so I wouldn't be surprised if that breaks.

From the way we structure our data in Redis, I don't think it's straightforward to guarantee that keys used in one transaction are in the same hash slot. Maybe someone with more experience in Redis can figure this out at some point... sorry!

EDIT: About the specific error you're seeing: That looks like a redirect, which I also didn't know existed. I'd hoped our redis library/connector/whatever handled that, but maybe it doesn't (by default?). Also something to investigate.

from chihaya.

sot-tech avatar sot-tech commented on May 23, 2024

@bochencwx

Hello.

First at all, to use cluster, client must be support cluster, but chihaya uses library which does not. So, chihaya should use one of solutions, mentioned in provided issue.

If you need cluster for HA, well... it is not the best solution, because it not guarantees data consistency and potentially may lose data if node without replica dies. For HA sentinel (which redigo also does not support) is better solution, but it a little bit complex. If it applicable, you can use keydb fork of redis in multi-master (which also known as 'active-active') or active replica mode with (or without) some proxy if front of nodes (i.e. haproxy).

from chihaya.

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.