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 cf2835519e
commit 964f6b17e9

View File

@ -2521,6 +2521,15 @@ void sentinelCommand(redisClient *c) {
sentinelFlushConfig(); sentinelFlushConfig();
addReply(c,shared.ok); 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 { } else {
addReplyErrorFormat(c,"Unknown sentinel subcommand '%s'", addReplyErrorFormat(c,"Unknown sentinel subcommand '%s'",
(char*)c->argv[1]->ptr); (char*)c->argv[1]->ptr);