Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
supercaracal committed Sep 5, 2024
1 parent af2662c commit f20d34c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,34 +144,34 @@ and not just the same node.
Therefore, The following error occurs:

```
$ redis-cli mget key1 key2 key3
$ redis-cli -c mget key1 key2 key3
(error) CROSSSLOT Keys in request don't hash to the same slot
$ redis-cli cluster keyslot key1
$ redis-cli -c cluster keyslot key1
(integer) 9189
$ redis-cli cluster keyslot key2
$ redis-cli -c cluster keyslot key2
(integer) 4998
$ redis-cli cluster keyslot key3
$ redis-cli -c cluster keyslot key3
(integer) 935
```

For the constraint, Redis cluster provides a feature to be able to bias keys to the same slot with a hash tag.

```
$ redis-cli mget {key}1 {key}2 {key}3
$ redis-cli -c mget {key}1 {key}2 {key}3
1) (nil)
2) (nil)
3) (nil)
$ redis-cli cluster keyslot {key}1
$ redis-cli -c cluster keyslot {key}1
(integer) 12539
$ redis-cli cluster keyslot {key}2
$ redis-cli -c cluster keyslot {key}2
(integer) 12539
$ redis-cli cluster keyslot {key}3
$ redis-cli -c cluster keyslot {key}3
(integer) 12539
```

Expand Down

0 comments on commit f20d34c

Please sign in to comment.