diff options
author | antirez <antirez@gmail.com> | 2014-01-10 15:39:10 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2014-01-13 16:39:44 +0100 |
commit | 560e548dc6b13413c4b6bacbcf42feae221b09c8 (patch) | |
tree | cbbc36ad7e313a9a6dd678fc8761e76cf3f4f5df | |
parent | 0ca750d94add42009ba1d1b645fa23c9dcf3796d (diff) | |
download | redis-560e548dc6b13413c4b6bacbcf42feae221b09c8.tar.gz |
Sentinel: SENTINEL REMOVE command added.
The command totally removes a monitored master.
-rw-r--r-- | src/sentinel.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/sentinel.c b/src/sentinel.c index 3d1477c97..ee6ec17c2 100644 --- a/src/sentinel.c +++ b/src/sentinel.c @@ -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); |