Sentinel: SENTINEL REMOVE command added.

The command totally removes a monitored master.
This commit is contained in:
antirez
2014-01-10 15:39:10 +01:00
parent 0ca750d94a
commit 560e548dc6

View File

@ -2523,6 +2523,15 @@ void sentinelCommand(redisClient *c) {
sentinelFlushConfig();
addReply(c,shared.ok);
}
} else if (!strcasecmp(c->argv[1]->ptr,"remove")) {
/* SENTINEL REMOVE <name> */
sentinelRedisInstance *ri;
if ((ri = sentinelGetMasterByNameOrReplyError(c,c->argv[2]))
== NULL) return;
dictDelete(sentinel.masters,c->argv[2]->ptr);
sentinelFlushConfig();
addReply(c,shared.ok);
} else {
addReplyErrorFormat(c,"Unknown sentinel subcommand '%s'",
(char*)c->argv[1]->ptr);