0% found this document useful (0 votes)
53 views1 page

Redis Cluster Specification-18

The document discusses CLUSTER SLOTS and key ranges in Redis clusters. It explains that CLUSTER SLOTS returns start-end slots and address-port pairs for masters and slaves serving each slot range. It also notes that multi-key operations may fail with a -TRYAGAIN error during resharding if the keys are split between nodes. Clients should retry operations after resharding or report the error.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views1 page

Redis Cluster Specification-18

The document discusses CLUSTER SLOTS and key ranges in Redis clusters. It explains that CLUSTER SLOTS returns start-end slots and address-port pairs for masters and slaves serving each slot range. It also notes that multi-key operations may fail with a -TRYAGAIN error during resharding if the keys are split between nodes. Clients should retry operations after resharding or report the error.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

2) (integer) 7002

4) 1) "127.0.0.1"

2) (integer) 7005

The first two sub-elements of every element of the returned array are the start-end slots
of the range. The additional elements represent address-port pairs. The first address-
port pair is the master serving the slot, and the additional address-port pairs are all the
slaves serving the same slot that are not in an error condition (i.e. the FAIL flag is not
set).
For example the first element of the output says that slots from 5461 to 10922 (start and
end included) are served by 127.0.0.1:7001, and it is possible to scale read-only load
contacting the slave at 127.0.0.1:7004.
CLUSTER SLOTS is not guaranteed to return ranges that cover the full 16384 slots if
the cluster is misconfigured, so clients should initialize the slots configuration map filling
the target nodes with NULL objects, and report an error if the user tries to execute
commands about keys that belong to unassigned slots.
Before returning an error to the caller when a slot is found to be unassigned, the client
should try to fetch the slots configuration again to check if the cluster is now configured
properly.

Multiple keys operations


Using hash tags, clients are free to use multi-key operations. For example the following
operation is valid:

MSET {user:1000}.name Angela {user:1000}.surname White

Multi-key operations may become unavailable when a resharding of the hash slot the
keys belong to is in progress.
More specifically, even during a resharding the multi-key operations targeting keys that
all exist and all still hash to the same slot (either the source or destination node) are still
available.
Operations on keys that don't exist or are - during the resharding - split between the
source and destination nodes, will generate a -TRYAGAIN error. The client can try the
operation after some time, or report back the error.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy