summaryrefslogtreecommitdiff
path: root/src/cluster.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2018-07-24 17:31:39 +0200
committerantirez <antirez@gmail.com>2018-07-24 17:31:43 +0200
commit0bdeb861f48b4bed269e80d9211c0ce854465a4a (patch)
tree31d0dc6bac09a6397a289f80237bffea9ebaa24b /src/cluster.c
parent53d46fa712619af7bcd7883aabe279344336be11 (diff)
downloadredis-0bdeb861f48b4bed269e80d9211c0ce854465a4a.tar.gz
Example the magic +1 in migrateCommand().
Related to #5154.
Diffstat (limited to 'src/cluster.c')
-rw-r--r--src/cluster.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cluster.c b/src/cluster.c
index 19688d593..8b76d9ad0 100644
--- a/src/cluster.c
+++ b/src/cluster.c
@@ -5226,6 +5226,10 @@ try_again:
int socket_error = 0;
int del_idx = 1; /* Index of the key argument for the replicated DEL op. */
+ /* Allocate the new argument vector that will replace the current command,
+ * to propagate the MIGRATE as a DEL command (if no COPY option was given).
+ * We allocate num_keys+1 because the additional argument is for "DEL"
+ * command name itself. */
if (!copy) newargv = zmalloc(sizeof(robj*)*(num_keys+1));
for (j = 0; j < num_keys-expired; j++) {