mirror of
https://github.com/fluencelabs/redis
synced 2025-03-17 16:10:50 +00:00
SPOP with count: fix replication for code path #3.
This commit is contained in:
parent
9feee428f2
commit
a37d0f8b48
12
src/t_set.c
12
src/t_set.c
@ -517,10 +517,18 @@ void spopWithCountCommand(redisClient *c) {
|
||||
si = setTypeInitIterator(set);
|
||||
while((encoding = setTypeNext(si,&objele,&llele)) != -1) {
|
||||
if (encoding == REDIS_ENCODING_INTSET) {
|
||||
addReplyBulkLongLong(c,llele);
|
||||
objele = createStringObjectFromLongLong(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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user