Skip to content
Discussion options

You must be logged in to vote

For github.com/go-redis/redis/v8 v8.11.0, no, not across different shards.

I checked the cluster client code for that version. It computes the slot from the first key and sends the whole MGET to a single node, so if the keys are in different slots Redis will return CROSSSLOT.

So for v8.11.0 your options are:

  • keep the keys in the same slot with hash tags
  • or group keys by slot and do separate MGET or GET calls

This seems to be improved in newer go-redis versions, but for the exact version you mentioned I would treat cross-shard MGET as unsupported.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ndyakov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants