diff options
author | Itamar Haber <itamar@redislabs.com> | 2020-03-11 18:43:03 +0200 |
---|---|---|
committer | Itamar Haber <itamar@redislabs.com> | 2020-03-11 18:43:03 +0200 |
commit | 7d703de7e938e72041a395b0dee435550fee7c5b (patch) | |
tree | eaa264ae753c1a91a0d898c2879a1e38477f7455 | |
parent | bd28dbee0ed53db74b21d702c23c3254cebdbc7f (diff) | |
download | redis-7d703de7e938e72041a395b0dee435550fee7c5b.tar.gz |
Adds keyspace notifications to migrate and restore
-rw-r--r-- | src/cluster.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cluster.c b/src/cluster.c index c05e46f76..5f63d2b8f 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -4981,6 +4981,7 @@ void restoreCommand(client *c) { } objectSetLRUOrLFU(obj,lfu_freq,lru_idle,lru_clock,1000); signalModifiedKey(c->db,c->argv[1]); + notifyKeyspaceEvent(NOTIFY_GENERIC,"restore",c->argv[1],c->db->id); addReply(c,shared.ok); server.dirty++; } @@ -5327,6 +5328,7 @@ try_again: /* No COPY option: remove the local key, signal the change. */ dbDelete(c->db,kv[j]); signalModifiedKey(c->db,kv[j]); + notifyKeyspaceEvent(NOTIFY_GENERIC,"del",kv[j],c->db->id); server.dirty++; /* Populate the argument vector to replace the old one. */ @@ -5489,7 +5491,7 @@ void readwriteCommand(client *c) { * already "down" but it is fragile to rely on the update of the global state, * so we also handle it here. * - * CLUSTER_REDIR_DOWN_STATE and CLUSTER_REDIR_DOWN_RO_STATE if the cluster is + * CLUSTER_REDIR_DOWN_STATE and CLUSTER_REDIR_DOWN_RO_STATE if the cluster is * down but the user attempts to execute a command that addresses one or more keys. */ clusterNode *getNodeByQuery(client *c, struct redisCommand *cmd, robj **argv, int argc, int *hashslot, int *error_code) { clusterNode *n = NULL; |