Skip to content

Commit

Permalink
BITOP: propagate only when it really SET or DEL targetkey (redis#5783)
Browse files Browse the repository at this point in the history
For example:
    BITOP not targetkey sourcekey

If targetkey and sourcekey doesn't exist, BITOP has no effect,
we do not propagate it, thus can save aof and replica flow.
  • Loading branch information
soloestoy authored Jul 10, 2020
1 parent ad0a9df commit 1978f99
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bitops.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,11 +759,12 @@ void bitopCommand(client *c) {
setKey(c,c->db,targetkey,o);
notifyKeyspaceEvent(NOTIFY_STRING,"set",targetkey,c->db->id);
decrRefCount(o);
server.dirty++;
} else if (dbDelete(c->db,targetkey)) {
signalModifiedKey(c,c->db,targetkey);
notifyKeyspaceEvent(NOTIFY_GENERIC,"del",targetkey,c->db->id);
server.dirty++;
}
server.dirty++;
addReplyLongLong(c,maxlen); /* Return the output string length in bytes. */
}

Expand Down

0 comments on commit 1978f99

Please sign in to comment.