diff --git a/src/commands/cmd_cluster.cc b/src/commands/cmd_cluster.cc index 4a6d5dbeb3d..f8e637281b4 100644 --- a/src/commands/cmd_cluster.cc +++ b/src/commands/cmd_cluster.cc @@ -357,11 +357,10 @@ class CommandAsking : public Commander { } }; -REDIS_REGISTER_COMMANDS(Cluster, - MakeCmdAttr("cluster", -2, "cluster no-script", NO_KEY, GenerateClusterFlag), - MakeCmdAttr("clusterx", -2, "cluster no-script", NO_KEY, GenerateClusterFlag), - MakeCmdAttr("readonly", 1, "cluster no-multi", NO_KEY), - MakeCmdAttr("readwrite", 1, "cluster no-multi", NO_KEY), - MakeCmdAttr("asking", 1, "cluster", NO_KEY), ) +REDIS_REGISTER_COMMANDS(Cluster, MakeCmdAttr("cluster", -2, "no-script", NO_KEY, GenerateClusterFlag), + MakeCmdAttr("clusterx", -2, "no-script", NO_KEY, GenerateClusterFlag), + MakeCmdAttr("readonly", 1, "no-multi", NO_KEY), + MakeCmdAttr("readwrite", 1, "no-multi", NO_KEY), + MakeCmdAttr("asking", 1, "", NO_KEY), ) } // namespace redis diff --git a/src/commands/commander.h b/src/commands/commander.h index 066c4ce86d8..b1d0a04975f 100644 --- a/src/commands/commander.h +++ b/src/commands/commander.h @@ -56,17 +56,30 @@ class Connection; struct CommandAttributes; enum CommandFlags : uint64_t { - kCmdWrite = 1ULL << 0, // "write" flag - kCmdReadOnly = 1ULL << 1, // "read-only" flag - kCmdLoading = 1ULL << 5, // "ok-loading" flag - kCmdEndMulti = 1ULL << 6, // "multi" flag, for ending a MULTI scope - kCmdExclusive = 1ULL << 7, // "exclusive" flag - kCmdNoMulti = 1ULL << 8, // "no-multi" flag - kCmdNoScript = 1ULL << 9, // "no-script" flag - kCmdCluster = 1ULL << 11, // "cluster" flag - kCmdNoDBSizeCheck = 1ULL << 12, // "no-dbsize-check" flag - kCmdSlow = 1ULL << 13, // "slow" flag - kCmdBlocking = 1ULL << 14, // "blocking" flag + // "write" flag, for any command that performs rocksdb writing ops + kCmdWrite = 1ULL << 0, + // "read-only" flag, for any command that performs rocksdb reading ops + // and doesn't perform rocksdb writing ops + kCmdReadOnly = 1ULL << 1, + // "ok-loading" flag, for any command that can be executed while + // the db is in loading phase + kCmdLoading = 1ULL << 5, + // "multi" flag, for commands that can end a MULTI scope + kCmdEndMulti = 1ULL << 6, + // "exclusive" flag, for commands that should be executed execlusive globally + kCmdExclusive = 1ULL << 7, + // "no-multi" flag, for commands that cannot be executed in MULTI scope + kCmdNoMulti = 1ULL << 8, + // "no-script" flag, for commands that cannot be executed in scripting + kCmdNoScript = 1ULL << 9, + // "no-dbsize-check" flag, for commands that can ignore the db size checking + kCmdNoDBSizeCheck = 1ULL << 12, + // "slow" flag, for commands that run slowly, + // usually with a non-constant number of rocksdb ops + kCmdSlow = 1ULL << 13, + // "blocking" flag, for commands that don't perform db ops immediately, + // but block and wait for some event to happen before performing db ops + kCmdBlocking = 1ULL << 14, }; enum class CommandCategory : uint8_t { @@ -309,8 +322,6 @@ inline uint64_t ParseCommandFlags(const std::string &description, const std::str flags |= kCmdNoMulti; else if (flag == "no-script") flags |= kCmdNoScript; - else if (flag == "cluster") - flags |= kCmdCluster; else if (flag == "no-dbsize-check") flags |= kCmdNoDBSizeCheck; else if (flag == "slow")