summaryrefslogtreecommitdiffstats
path: root/iredis/data/commands/cluster-replicate.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2020-03-21 10:28:17 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-02-07 11:16:53 +0000
commit06cba6ccd165ca8b224797e37fccb9e63f026d77 (patch)
treee82f1bc439997ae296f2e74f8a64d84c5d95f140 /iredis/data/commands/cluster-replicate.md
parentInitial commit. (diff)
downloadiredis-06cba6ccd165ca8b224797e37fccb9e63f026d77.tar.xz
iredis-06cba6ccd165ca8b224797e37fccb9e63f026d77.zip
Adding upstream version 1.9.1.upstream/1.9.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'iredis/data/commands/cluster-replicate.md')
-rw-r--r--iredis/data/commands/cluster-replicate.md29
1 files changed, 29 insertions, 0 deletions
diff --git a/iredis/data/commands/cluster-replicate.md b/iredis/data/commands/cluster-replicate.md
new file mode 100644
index 0000000..ab5cf5c
--- /dev/null
+++ b/iredis/data/commands/cluster-replicate.md
@@ -0,0 +1,29 @@
+The command reconfigures a node as a replica of the specified master. If the
+node receiving the command is an _empty master_, as a side effect of the
+command, the node role is changed from master to replica.
+
+Once a node is turned into the replica of another master node, there is no need
+to inform the other cluster nodes about the change: heartbeat packets exchanged
+between nodes will propagate the new configuration automatically.
+
+A replica will always accept the command, assuming that:
+
+1. The specified node ID exists in its nodes table.
+2. The specified node ID does not identify the instance we are sending the
+ command to.
+3. The specified node ID is a master.
+
+If the node receiving the command is not already a replica, but is a master, the
+command will only succeed, and the node will be converted into a replica, only
+if the following additional conditions are met:
+
+1. The node is not serving any hash slots.
+2. The node is empty, no keys are stored at all in the key space.
+
+If the command succeeds the new replica will immediately try to contact its
+master in order to replicate from it.
+
+@return
+
+@simple-string-reply: `OK` if the command was executed successfully, otherwise
+an error is returned.