Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
19880ab8
Unverified
Commit
19880ab8
authored
Aug 26, 2018
by
Salvatore Sanfilippo
Committed by
GitHub
Aug 26, 2018
Browse files
Merge pull request #5248 from soloestoy/rewrite-brpoplpush
rewrite BRPOPLPUSH as RPOPLPUSH to propagate
parents
80e16956
9a65f9cd
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/blocked.c
View file @
19880ab8
...
@@ -269,7 +269,7 @@ void handleClientsBlockedOnKeys(void) {
...
@@ -269,7 +269,7 @@ void handleClientsBlockedOnKeys(void) {
robj
*
dstkey
=
receiver
->
bpop
.
target
;
robj
*
dstkey
=
receiver
->
bpop
.
target
;
int
where
=
(
receiver
->
lastcmd
&&
int
where
=
(
receiver
->
lastcmd
&&
receiver
->
lastcmd
->
proc
==
blpopCommand
)
?
receiver
->
lastcmd
->
proc
==
blpopCommand
)
?
LIST_HEAD
:
LIST_TAIL
;
LIST_HEAD
:
LIST_TAIL
;
robj
*
value
=
listTypePop
(
o
,
where
);
robj
*
value
=
listTypePop
(
o
,
where
);
if
(
value
)
{
if
(
value
)
{
...
@@ -285,7 +285,7 @@ void handleClientsBlockedOnKeys(void) {
...
@@ -285,7 +285,7 @@ void handleClientsBlockedOnKeys(void) {
{
{
/* If we failed serving the client we need
/* If we failed serving the client we need
* to also undo the POP operation. */
* to also undo the POP operation. */
listTypePush
(
o
,
value
,
where
);
listTypePush
(
o
,
value
,
where
);
}
}
if
(
dstkey
)
decrRefCount
(
dstkey
);
if
(
dstkey
)
decrRefCount
(
dstkey
);
...
...
src/server.c
View file @
19880ab8
...
@@ -1491,6 +1491,7 @@ void createSharedObjects(void) {
...
@@ -1491,6 +1491,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
);
shared
.
zpopmin
=
createStringObject
(
"ZPOPMIN"
,
7
);
shared
.
zpopmin
=
createStringObject
(
"ZPOPMIN"
,
7
);
shared
.
zpopmax
=
createStringObject
(
"ZPOPMAX"
,
7
);
shared
.
zpopmax
=
createStringObject
(
"ZPOPMAX"
,
7
);
for
(
j
=
0
;
j
<
OBJ_SHARED_INTEGERS
;
j
++
)
{
for
(
j
=
0
;
j
<
OBJ_SHARED_INTEGERS
;
j
++
)
{
...
...
src/server.h
View file @
19880ab8
...
@@ -782,7 +782,7 @@ struct sharedObjectsStruct {
...
@@ -782,7 +782,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
,
*
zpopmin
,
*
zpopmax
,
*
emptyscan
,
*
rpop
,
*
lpop
,
*
lpush
,
*
rpoplpush
,
*
zpopmin
,
*
zpopmax
,
*
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" */
...
...
src/t_list.c
View file @
19880ab8
...
@@ -596,6 +596,9 @@ void rpoplpushCommand(client *c) {
...
@@ -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
->
lastcmd
->
proc
==
brpoplpushCommand
)
{
rewriteClientCommandVector
(
c
,
3
,
shared
.
rpoplpush
,
c
->
argv
[
1
],
c
->
argv
[
2
]);
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment