summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvattezhang <vattezhang@163.com>2019-02-27 21:20:00 +0800
committervattezhang <vattezhang@163.com>2019-02-27 21:20:00 +0800
commit0f0f787a37e6411a02d9a992ecc7bb8af7decf9a (patch)
tree42581f96c215f95deaf4a9d3963f976abf38d481 /src
parent4cc43a96f67e155a3526a29816510536ef9380c7 (diff)
downloadredis-0f0f787a37e6411a02d9a992ecc7bb8af7decf9a.tar.gz
fix: fix sentinel command table and new flags format
Diffstat (limited to 'src')
-rw-r--r--src/sentinel.c13
-rw-r--r--src/server.h1
2 files changed, 10 insertions, 4 deletions
diff --git a/src/sentinel.c b/src/sentinel.c
index 4d03c9c12..92ea75436 100644
--- a/src/sentinel.c
+++ b/src/sentinel.c
@@ -450,11 +450,11 @@ struct redisCommand sentinelcmds[] = {
{"punsubscribe",punsubscribeCommand,-1,"",0,NULL,0,0,0,0,0},
{"publish",sentinelPublishCommand,3,"",0,NULL,0,0,0,0,0},
{"info",sentinelInfoCommand,-1,"",0,NULL,0,0,0,0,0},
- {"role",sentinelRoleCommand,1,"l",0,NULL,0,0,0,0,0},
- {"client",clientCommand,-2,"rs",0,NULL,0,0,0,0,0},
+ {"role",sentinelRoleCommand,1,"ok-loading",0,NULL,0,0,0,0,0},
+ {"client",clientCommand,-2,"read-only no-script",0,NULL,0,0,0,0,0},
{"shutdown",shutdownCommand,-1,"",0,NULL,0,0,0,0,0},
- {"auth",authCommand,2,"sltF",0,NULL,0,0,0,0,0},
- {"hello",helloCommand,-2,"sF",0,NULL,0,0,0,0,0}
+ {"auth",authCommand,2,"no-script ok-loading ok-stale fast",0,NULL,0,0,0,0,0},
+ {"hello",helloCommand,-2,"no-script fast",0,NULL,0,0,0,0,0}
};
/* This function overwrites a few normal Redis config default with Sentinel
@@ -477,6 +477,11 @@ void initSentinel(void) {
retval = dictAdd(server.commands, sdsnew(cmd->name), cmd);
serverAssert(retval == DICT_OK);
+
+ /* Translate the command string flags description into an actual
+ * set of flags. */
+ if (populateCommandTableParseFlags(cmd,cmd->sflags) == C_ERR)
+ serverPanic("Unsupported command flag");
}
/* Initialize various data structures. */
diff --git a/src/server.h b/src/server.h
index 994952654..c29a40b6b 100644
--- a/src/server.h
+++ b/src/server.h
@@ -2264,6 +2264,7 @@ void serverLogHexDump(int level, char *descr, void *value, size_t len);
int memtest_preserving_test(unsigned long *m, size_t bytes, int passes);
void mixDigest(unsigned char *digest, void *ptr, size_t len);
void xorDigest(unsigned char *digest, void *ptr, size_t len);
+int populateCommandTableParseFlags(struct redisCommand *c, char *strflags);
#define redisDebug(fmt, ...) \
printf("DEBUG %s:%d > " fmt "\n", __FILE__, __LINE__, __VA_ARGS__)