Git Product home page Git Product logo

Comments (8)

manjuraj avatar manjuraj commented on August 23, 2024

We do have plans to support EVAL.

But before we support EVAL/EVALSHA, we need to support #9. This is because, if sharding is done on the "keynames", we would require all the "keys" in EVAL command to map to the same server. Unlike mget and del, we cannot fragment EVAL command.

what do you think?

from twemproxy.

jgallartm avatar jgallartm commented on August 23, 2024

It makes a lot of sense.

Thanks

Javi

from twemproxy.

manjuraj avatar manjuraj commented on August 23, 2024

we have 'hash tags' now on head. so this should be easy to support

from twemproxy.

squamos avatar squamos commented on August 23, 2024

+1 For this feature

from twemproxy.

tan-lawrence avatar tan-lawrence commented on August 23, 2024

Hi manjuraj,

I have written a patch that provides rudimentary EVAL/EVALSHA support for scripts that take exactly one key. I can expand that to more generic support, but I wanted to know if you had any thoughts about how that should look like.

Specifically:

  1. The sharding algorithm (or even the characters that determine the hash tag part of a key) isn't known in the redis protocol parser (nc_redis.c). We either have to expose this to the parser, or we have to expand struct msg to hold multiple keys so that either the parser or server_pool_conn() can determine if the query is well-formed. Do you have an opinion either way?
  2. Do we support EVAL of scripts that take 0 keys (e.g. EVAL "return 0" 0) - should we execute this on an arbitrary server, or make it mandatory for at least 1 key to be provided even if the script doesn't use the key so the server the script is executed on is deterministically picked?

Thanks

from twemproxy.

manjuraj avatar manjuraj commented on August 23, 2024

@ferenyx send a pull request :)

I think for EVAL and EVALSHA commands taking >= 1 key, we should do sharding on the 1st key with the hope that client uses 'hash tags' and has the same hash tag for all the keys in the EVAL and EVALSHA command.

See #54 (comment) for more discussion on this

from twemproxy.

tan-lawrence avatar tan-lawrence commented on August 23, 2024

I sent a pull request, and that's now at issue #60. Thanks!

from twemproxy.

manjuraj avatar manjuraj commented on August 23, 2024

Fixed by @ferenyx. See: 4e117f8

from twemproxy.

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.