Merge pull request #6976 from itamarhaber/ksn-patch

Adds keyspace notifications to migrate and restore
This commit is contained in:
Salvatore Sanfilippo 2020-03-13 12:35:00 +01:00 committed by GitHub
commit cf6cbbb881
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4981,6 +4981,7 @@ void restoreCommand(client *c) {
} }
objectSetLRUOrLFU(obj,lfu_freq,lru_idle,lru_clock,1000); objectSetLRUOrLFU(obj,lfu_freq,lru_idle,lru_clock,1000);
signalModifiedKey(c->db,c->argv[1]); signalModifiedKey(c->db,c->argv[1]);
notifyKeyspaceEvent(NOTIFY_GENERIC,"restore",c->argv[1],c->db->id);
addReply(c,shared.ok); addReply(c,shared.ok);
server.dirty++; server.dirty++;
} }
@ -5327,6 +5328,7 @@ try_again:
/* No COPY option: remove the local key, signal the change. */ /* No COPY option: remove the local key, signal the change. */
dbDelete(c->db,kv[j]); dbDelete(c->db,kv[j]);
signalModifiedKey(c->db,kv[j]); signalModifiedKey(c->db,kv[j]);
notifyKeyspaceEvent(NOTIFY_GENERIC,"del",kv[j],c->db->id);
server.dirty++; server.dirty++;
/* Populate the argument vector to replace the old one. */ /* Populate the argument vector to replace the old one. */