diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-01-04 07:19:32 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-01-04 07:19:32 +0000 |
commit | 7480e618ec785ba8a1c74c8a150cffe5880fb3bb (patch) | |
tree | 87422376dd9a7eee55850f0fce9a8bb4c13e44a2 /iredis/data/commands/cluster-addslots.md | |
parent | Adding upstream version 1.12.1. (diff) | |
download | iredis-df49d7c38b2b8498c93215691d16403b32becec8.tar.xz iredis-df49d7c38b2b8498c93215691d16403b32becec8.zip |
Adding upstream version 1.13.0.upstream/1.13.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'iredis/data/commands/cluster-addslots.md')
-rw-r--r-- | iredis/data/commands/cluster-addslots.md | 48 |
1 files changed, 22 insertions, 26 deletions
diff --git a/iredis/data/commands/cluster-addslots.md b/iredis/data/commands/cluster-addslots.md index b7b777a..0604066 100644 --- a/iredis/data/commands/cluster-addslots.md +++ b/iredis/data/commands/cluster-addslots.md @@ -1,55 +1,51 @@ This command is useful in order to modify a node's view of the cluster -configuration. Specifically it assigns a set of hash slots to the node receiving -the command. If the command is successful, the node will map the specified hash -slots to itself, and will start broadcasting the new configuration. +configuration. Specifically it assigns a set of hash slots to the node +receiving the command. If the command is successful, the node will map +the specified hash slots to itself, and will start broadcasting the new +configuration. However note that: -1. The command only works if all the specified slots are, from the point of view - of the node receiving the command, currently not assigned. A node will refuse - to take ownership for slots that already belong to some other node (including - itself). +1. The command only works if all the specified slots are, from the point of view of the node receiving the command, currently not assigned. A node will refuse to take ownership for slots that already belong to some other node (including itself). 2. The command fails if the same slot is specified multiple times. -3. As a side effect of the command execution, if a slot among the ones specified - as argument is set as `importing`, this state gets cleared once the node - assigns the (previously unbound) slot to itself. +3. As a side effect of the command execution, if a slot among the ones specified as argument is set as `importing`, this state gets cleared once the node assigns the (previously unbound) slot to itself. ## Example -For example the following command assigns slots 1 2 3 to the node receiving the -command: +For example the following command assigns slots 1 2 3 to the node receiving +the command: > CLUSTER ADDSLOTS 1 2 3 OK -However trying to execute it again results into an error since the slots are -already assigned: +However trying to execute it again results into an error since the slots +are already assigned: > CLUSTER ADDSLOTS 1 2 3 ERR Slot 1 is already busy ## Usage in Redis Cluster -This command only works in cluster mode and is useful in the following Redis -Cluster operations: +This command only works in cluster mode and is useful in the following +Redis Cluster operations: -1. To create a new cluster ADDSLOTS is used in order to initially setup master - nodes splitting the available hash slots among them. +1. To create a new cluster ADDSLOTS is used in order to initially setup master nodes splitting the available hash slots among them. 2. In order to fix a broken cluster where certain slots are unassigned. ## Information about slots propagation and warnings Note that once a node assigns a set of slots to itself, it will start -propagating this information in heartbeat packet headers. However the other -nodes will accept the information only if they have the slot as not already -bound with another node, or if the configuration epoch of the node advertising -the new hash slot, is greater than the node currently listed in the table. +propagating this information in heartbeat packet headers. However the +other nodes will accept the information only if they have the slot as +not already bound with another node, or if the configuration epoch of the +node advertising the new hash slot, is greater than the node currently listed +in the table. This means that this command should be used with care only by applications -orchestrating Redis Cluster, like `redis-cli`, and the command if used out of -the right context can leave the cluster in a wrong state or cause data loss. +orchestrating Redis Cluster, like `redis-cli`, and the command if used +out of the right context can leave the cluster in a wrong state or cause +data loss. @return -@simple-string-reply: `OK` if the command was successful. Otherwise an error is -returned. +@simple-string-reply: `OK` if the command was successful. Otherwise an error is returned. |