Unverified Commit 9d0158bf authored by Chen Tianjie's avatar Chen Tianjie Committed by GitHub
Browse files

Reorder signalModifiedKey in xaddCommand. (#12895)

This PR is a supplement to #11144, moving `signalModifiedKey` in
`xaddCommand` after the trimming, to ensure the state of key eventual
consistency. Currently there is no problem with Redis, but it is better
to avoid issues in future development on Redis.
parent 2c5b51ad
...@@ -2052,7 +2052,6 @@ void xaddCommand(client *c) { ...@@ -2052,7 +2052,6 @@ void xaddCommand(client *c) {
sds replyid = createStreamIDString(&id); sds replyid = createStreamIDString(&id);
addReplyBulkCBuffer(c, replyid, sdslen(replyid)); addReplyBulkCBuffer(c, replyid, sdslen(replyid));
signalModifiedKey(c,c->db,c->argv[1]);
notifyKeyspaceEvent(NOTIFY_STREAM,"xadd",c->argv[1],c->db->id); notifyKeyspaceEvent(NOTIFY_STREAM,"xadd",c->argv[1],c->db->id);
server.dirty++; server.dirty++;
...@@ -2072,6 +2071,8 @@ void xaddCommand(client *c) { ...@@ -2072,6 +2071,8 @@ void xaddCommand(client *c) {
} }
} }
signalModifiedKey(c,c->db,c->argv[1]);
/* Let's rewrite the ID argument with the one actually generated for /* Let's rewrite the ID argument with the one actually generated for
* AOF/replication propagation. */ * AOF/replication propagation. */
if (!parsed_args.id_given || !parsed_args.seq_given) { if (!parsed_args.id_given || !parsed_args.seq_given) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment