ZPOP: fix replication of blocking ZPOP.

This commit is contained in:
antirez 2018-05-15 16:03:56 +02:00
parent e87c1f1e6c
commit 25f017e563

View File

@ -333,10 +333,18 @@ void handleClientsBlockedOnKeys(void) {
unblockClient(receiver); unblockClient(receiver);
genericZpopCommand(receiver,&rl->key,1,where,1,NULL); genericZpopCommand(receiver,&rl->key,1,where,1,NULL);
propagate(where == ZSET_MIN ? /* Replicate the command. */
server.zpopminCommand : server.zpopmaxCommand, robj *argv[2];
receiver->db->id,receiver->argv,receiver->argc, struct redisCommand *cmd = where == ZSET_MIN ?
PROPAGATE_AOF|PROPAGATE_REPL); server.zpopminCommand :
server.zpopmaxCommand;
argv[0] = createStringObject(cmd->name,strlen(cmd->name));
argv[1] = rl->key;
incrRefCount(rl->key);
propagate(cmd,receiver->db->id,
argv,2,PROPAGATE_AOF|PROPAGATE_REPL);
decrRefCount(argv[0]);
decrRefCount(argv[1]);
} }
} }
} }