Skip to content

Commit

Permalink
Redis: normalize results of Command.create()
Browse files Browse the repository at this point in the history
When the `Command.create()` method is used to create a `Command` instance
for a known command (not recommended, but also not forbidden), it returns
a generic instance that doesn't know anything about where the keys are in
the command. Such generic instance is unusable with Redis cluster, because
the target node will be selected randomly, not based on the key, and there's
high chance such command will result in the `MOVED` redirect.

With this commit, we normalize all results of `Command.create()` so that
a pre-existing static instance for known commands it used. This is key-aware
and works with Redis cluster.

This commit adapts a fix submitted to Vert.x Redis client. When we upgrade
to a fixed Vert.x Redis client, this commit should be reverted.
  • Loading branch information
Ladicek committed Oct 19, 2023
1 parent 6fa9857 commit de0a9ca
Show file tree
Hide file tree
Showing 4 changed files with 419 additions and 2 deletions.
Loading

0 comments on commit de0a9ca

Please sign in to comment.