git-hulk commented on code in PR #2494:
URL: https://github.com/apache/kvrocks/pull/2494#discussion_r1721132039
##########
src/commands/cmd_hash.cc:
##########
@@ -440,11 +439,11 @@ REDIS_REGISTER_COMMANDS(Hash,
MakeCmdAttr<CommandHGet>("hget", 3, "read-only", 1
MakeCmdAttr<CommandHLen>("hlen", 2, "read-only", 1, 1,
1),
MakeCmdAttr<CommandHMGet>("hmget", -3, "read-only", 1,
1, 1),
MakeCmdAttr<CommandHMSet>("hmset", -4, "write", 1, 1,
1),
- MakeCmdAttr<CommandHKeys>("hkeys", 2, "read-only", 1,
1, 1),
- MakeCmdAttr<CommandHVals>("hvals", 2, "read-only", 1,
1, 1),
+ MakeCmdAttr<CommandHKeys>("hkeys", 2, "read-only
slow", 1, 1, 1),
+ MakeCmdAttr<CommandHVals>("hvals", 2, "read-only
slow", 1, 1, 1),
MakeCmdAttr<CommandHGetAll>("hgetall", 2, "read-only",
1, 1, 1),
Review Comment:
HGETALL should be a slow command
##########
src/commands/cmd_hash.cc:
##########
@@ -299,7 +299,6 @@ class CommandHGetAll : public Commander {
if (!s.ok()) {
return {Status::RedisExecErr, s.ToString()};
}
-
Review Comment:
Can reverse this line.
##########
src/commands/cmd_list.cc:
##########
@@ -633,7 +633,6 @@ class CommandLTrim : public Commander {
start_ = *parse_start;
stop_ = *parse_stop;
-
Review Comment:
Can revert this line.
##########
src/server/redis_connection.cc:
##########
@@ -367,6 +367,7 @@ static bool IsCmdForIndexing(const CommandAttributes *attr)
{
attr->category == CommandCategory::Key);
}
+// TODO: Handle slow flag
Review Comment:
```suggestion
```
##########
src/commands/cmd_zset.cc:
##########
@@ -1517,7 +1517,7 @@ REDIS_REGISTER_COMMANDS(ZSet,
MakeCmdAttr<CommandZAdd>("zadd", -4, "write", 1, 1
MakeCmdAttr<CommandZCount>("zcount", 4, "read-only",
1, 1, 1),
MakeCmdAttr<CommandZIncrBy>("zincrby", 4, "write", 1,
1, 1),
MakeCmdAttr<CommandZInterStore>("zinterstore", -4,
"write", CommandZInterStore::Range),
- MakeCmdAttr<CommandZInter>("zinter", -3, "read-only",
CommandZInter::Range),
+ MakeCmdAttr<CommandZInter>("zinter", -3, "read-only
slow", CommandZInter::Range),
MakeCmdAttr<CommandZInterCard>("zintercard", -3,
"read-only", CommandZInterCard::Range),
Review Comment:
Same as the SET commands, ZINTER*/ZUNION*/ZDIFF* should be identified as a
slow command.
##########
src/commands/cmd_hash.cc:
##########
@@ -440,11 +439,11 @@ REDIS_REGISTER_COMMANDS(Hash,
MakeCmdAttr<CommandHGet>("hget", 3, "read-only", 1
MakeCmdAttr<CommandHLen>("hlen", 2, "read-only", 1, 1,
1),
MakeCmdAttr<CommandHMGet>("hmget", -3, "read-only", 1,
1, 1),
MakeCmdAttr<CommandHMSet>("hmset", -4, "write", 1, 1,
1),
- MakeCmdAttr<CommandHKeys>("hkeys", 2, "read-only", 1,
1, 1),
- MakeCmdAttr<CommandHVals>("hvals", 2, "read-only", 1,
1, 1),
+ MakeCmdAttr<CommandHKeys>("hkeys", 2, "read-only
slow", 1, 1, 1),
+ MakeCmdAttr<CommandHVals>("hvals", 2, "read-only
slow", 1, 1, 1),
MakeCmdAttr<CommandHGetAll>("hgetall", 2, "read-only",
1, 1, 1),
MakeCmdAttr<CommandHScan>("hscan", -3, "read-only", 1,
1, 1),
- MakeCmdAttr<CommandHRangeByLex>("hrangebylex", -4,
"read-only", 1, 1, 1),
+ MakeCmdAttr<CommandHRangeByLex>("hrangebylex", -4,
"read-only slow", 1, 1, 1),
Review Comment:
HRANGEBYLET is not a slow command
##########
src/commands/cmd_set.cc:
##########
@@ -440,15 +440,15 @@ class CommandSScan : public CommandSubkeyScanBase {
REDIS_REGISTER_COMMANDS(Set, MakeCmdAttr<CommandSAdd>("sadd", -3, "write", 1,
1, 1),
MakeCmdAttr<CommandSRem>("srem", -3, "write
no-dbsize-check", 1, 1, 1),
MakeCmdAttr<CommandSCard>("scard", 2, "read-only", 1,
1, 1),
- MakeCmdAttr<CommandSMembers>("smembers", 2,
"read-only", 1, 1, 1),
+ MakeCmdAttr<CommandSMembers>("smembers", 2, "read-only
slow", 1, 1, 1),
MakeCmdAttr<CommandSIsMember>("sismember", 3,
"read-only", 1, 1, 1),
MakeCmdAttr<CommandSMIsMember>("smismember", -3,
"read-only", 1, 1, 1),
MakeCmdAttr<CommandSPop>("spop", -2, "write", 1, 1, 1),
MakeCmdAttr<CommandSRandMember>("srandmember", -2,
"read-only", 1, 1, 1),
MakeCmdAttr<CommandSMove>("smove", 4, "write", 1, 2,
1),
- MakeCmdAttr<CommandSDiff>("sdiff", -2, "read-only", 1,
-1, 1),
- MakeCmdAttr<CommandSUnion>("sunion", -2, "read-only",
1, -1, 1),
- MakeCmdAttr<CommandSInter>("sinter", -2, "read-only",
1, -1, 1),
+ MakeCmdAttr<CommandSDiff>("sdiff", -2, "read-only
slow", 1, -1, 1),
+ MakeCmdAttr<CommandSUnion>("sunion", -2, "read-only
slow", 1, -1, 1),
+ MakeCmdAttr<CommandSInter>("sinter", -2, "read-only
slow", 1, -1, 1),
MakeCmdAttr<CommandSInterCard>("sintercard", -3,
"read-only", CommandSInterCard::Range),
Review Comment:
sintercard/sdiffstore/sunionstore/sinterstore should be slow commands as
well.
##########
src/commands/cmd_server.cc:
##########
@@ -838,7 +838,6 @@ class CommandScan : public CommandScanBase {
Status Execute(Server *srv, Connection *conn, std::string *output) override {
redis::Database redis_db(srv->storage, conn->GetNamespace());
auto key_name = srv->GetKeyNameFromCursor(cursor_, CursorType::kTypeBase);
-
Review Comment:
Can revert this line.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]