diff options
author | antirez <antirez@gmail.com> | 2018-07-24 17:31:39 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2018-07-24 17:31:43 +0200 |
commit | 0bdeb861f48b4bed269e80d9211c0ce854465a4a (patch) | |
tree | 31d0dc6bac09a6397a289f80237bffea9ebaa24b /src/cluster.c | |
parent | 53d46fa712619af7bcd7883aabe279344336be11 (diff) | |
download | redis-0bdeb861f48b4bed269e80d9211c0ce854465a4a.tar.gz |
Example the magic +1 in migrateCommand().
Related to #5154.
Diffstat (limited to 'src/cluster.c')
-rw-r--r-- | src/cluster.c | 4 |
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++) { |