Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some questions about gears in cluster envrionment #53

Open
gamblewin opened this issue Aug 11, 2023 · 1 comment
Open

Some questions about gears in cluster envrionment #53

gamblewin opened this issue Aug 11, 2023 · 1 comment

Comments

@gamblewin
Copy link

Since for now, i don't have Redisgears cluster environment, can not conduct experiments, so may need to ask these questions.

  1. Dose gears support put key into a specific slot? such as exec('set', '{slot1}key1', '1')?

  2. When execute gears function, it seems gears, not like lua, doesn't require all keys to be operated in the same slot. But what if i only want to execute functions on keys in one slot, but gears will execute on all shards, isn't that a waste of computing resource?

image
  1. If i make gears function atomic, and it runs on all shards in cluster, so does that mean whole redis cluster will be blocked?
@MeirShpilraien
Copy link
Collaborator

  1. RedisGears 1.0 supports it but its not safe operation and so not recommended (for example, its not atomic, and there is no guarantee the write will successed ...). This is why on gears 2.0 we only allow reading from other shards.
  2. On gears 1 you have the execution mode which you can set if you want the function to run on all shards or just on the local shard: https://oss.redis.com/redisgears/functions.html#register. On gears 2.0 we matches the API to Redis Function, the tfcall command gets the keys and the command runs on the shards responsible for the keys.
  3. Depends on the execution mode, if you only run on the local shard only this shard will be blocked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants