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
a37d0f8b
Commit
a37d0f8b
authored
Feb 11, 2015
by
antirez
Browse files
SPOP with count: fix replication for code path #3.
parent
9feee428
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/t_set.c
View file @
a37d0f8b
...
...
@@ -517,10 +517,18 @@ void spopWithCountCommand(redisClient *c) {
si
=
setTypeInitIterator
(
set
);
while
((
encoding
=
setTypeNext
(
si
,
&
objele
,
&
llele
))
!=
-
1
)
{
if
(
encoding
==
REDIS_ENCODING_INTSET
)
{
addReplyBulk
LongLong
(
c
,
llele
);
objele
=
createStringObjectFrom
LongLong
(
llele
);
}
else
{
addReplyBulk
(
c
,
objele
);
incrRefCount
(
objele
);
}
addReplyBulk
(
c
,
objele
);
/* Replicate/AOF this command as an SREM operation */
propargv
[
2
]
=
objele
;
alsoPropagate
(
server
.
sremCommand
,
c
->
db
->
id
,
propargv
,
3
,
REDIS_PROPAGATE_AOF
|
REDIS_PROPAGATE_REPL
);
decrRefCount
(
objele
);
}
setTypeReleaseIterator
(
si
);
decrRefCount
(
set
);
...
...
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