mirror of
http://github.com/valkey-io/valkey
synced 2024-11-22 00:52:38 +00:00
Merge pull request #5822 from soloestoy/rewrite-brpoplpush-4.0
rewrite BRPOPLPUSH as RPOPLPUSH to propagate
This commit is contained in:
commit
77b4a0eb1a
@ -1320,6 +1320,7 @@ void createSharedObjects(void) {
|
|||||||
shared.rpop = createStringObject("RPOP",4);
|
shared.rpop = createStringObject("RPOP",4);
|
||||||
shared.lpop = createStringObject("LPOP",4);
|
shared.lpop = createStringObject("LPOP",4);
|
||||||
shared.lpush = createStringObject("LPUSH",5);
|
shared.lpush = createStringObject("LPUSH",5);
|
||||||
|
shared.rpoplpush = createStringObject("RPOPLPUSH",9);
|
||||||
for (j = 0; j < OBJ_SHARED_INTEGERS; j++) {
|
for (j = 0; j < OBJ_SHARED_INTEGERS; j++) {
|
||||||
shared.integers[j] =
|
shared.integers[j] =
|
||||||
makeObjectShared(createObject(OBJ_STRING,(void*)(long)j));
|
makeObjectShared(createObject(OBJ_STRING,(void*)(long)j));
|
||||||
|
@ -749,7 +749,7 @@ struct sharedObjectsStruct {
|
|||||||
*masterdownerr, *roslaveerr, *execaborterr, *noautherr, *noreplicaserr,
|
*masterdownerr, *roslaveerr, *execaborterr, *noautherr, *noreplicaserr,
|
||||||
*busykeyerr, *oomerr, *plus, *messagebulk, *pmessagebulk, *subscribebulk,
|
*busykeyerr, *oomerr, *plus, *messagebulk, *pmessagebulk, *subscribebulk,
|
||||||
*unsubscribebulk, *psubscribebulk, *punsubscribebulk, *del, *unlink,
|
*unsubscribebulk, *psubscribebulk, *punsubscribebulk, *del, *unlink,
|
||||||
*rpop, *lpop, *lpush, *emptyscan,
|
*rpop, *lpop, *lpush, *rpoplpush, *emptyscan,
|
||||||
*select[PROTO_SHARED_SELECT_CMDS],
|
*select[PROTO_SHARED_SELECT_CMDS],
|
||||||
*integers[OBJ_SHARED_INTEGERS],
|
*integers[OBJ_SHARED_INTEGERS],
|
||||||
*mbulkhdr[OBJ_SHARED_BULKHDR_LEN], /* "*<value>\r\n" */
|
*mbulkhdr[OBJ_SHARED_BULKHDR_LEN], /* "*<value>\r\n" */
|
||||||
|
@ -596,6 +596,9 @@ void rpoplpushCommand(client *c) {
|
|||||||
signalModifiedKey(c->db,touchedkey);
|
signalModifiedKey(c->db,touchedkey);
|
||||||
decrRefCount(touchedkey);
|
decrRefCount(touchedkey);
|
||||||
server.dirty++;
|
server.dirty++;
|
||||||
|
if (c->cmd->proc == brpoplpushCommand) {
|
||||||
|
rewriteClientCommandVector(c,3,shared.rpoplpush,c->argv[1],c->argv[2]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user