This is an automated email from the ASF dual-hosted git repository.

torwig pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/kvrocks.git


The following commit(s) were added to refs/heads/unstable by this push:
     new e3211c15 feat(command): add slow flag to more commands (#2570)
e3211c15 is described below

commit e3211c156f400788a9f1934736be0cddcd51bb12
Author: Twice <[email protected]>
AuthorDate: Thu Oct 3 16:02:34 2024 +0800

    feat(command): add slow flag to more commands (#2570)
---
 src/commands/cmd_hash.cc   | 2 +-
 src/commands/cmd_key.cc    | 4 ++--
 src/commands/cmd_search.cc | 3 ++-
 src/commands/cmd_server.cc | 2 +-
 src/commands/cmd_set.cc    | 2 +-
 src/commands/cmd_txn.cc    | 2 +-
 6 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/commands/cmd_hash.cc b/src/commands/cmd_hash.cc
index a3aee46a..a319ec23 100644
--- a/src/commands/cmd_hash.cc
+++ b/src/commands/cmd_hash.cc
@@ -461,6 +461,6 @@ REDIS_REGISTER_COMMANDS(Hash, 
MakeCmdAttr<CommandHGet>("hget", 3, "read-only", 1
                         MakeCmdAttr<CommandHGetAll>("hgetall", 2, "read-only 
slow", 1, 1, 1),
                         MakeCmdAttr<CommandHScan>("hscan", -3, "read-only", 1, 
1, 1),
                         MakeCmdAttr<CommandHRangeByLex>("hrangebylex", -4, 
"read-only", 1, 1, 1),
-                        MakeCmdAttr<CommandHRandField>("hrandfield", -2, 
"read-only", 1, 1, 1), )
+                        MakeCmdAttr<CommandHRandField>("hrandfield", -2, 
"read-only slow", 1, 1, 1), )
 
 }  // namespace redis
diff --git a/src/commands/cmd_key.cc b/src/commands/cmd_key.cc
index fecf4d55..63443753 100644
--- a/src/commands/cmd_key.cc
+++ b/src/commands/cmd_key.cc
@@ -572,7 +572,7 @@ REDIS_REGISTER_COMMANDS(Key, MakeCmdAttr<CommandTTL>("ttl", 
2, "read-only", 1, 1
                         MakeCmdAttr<CommandRename>("rename", 3, "write", 1, 2, 
1),
                         MakeCmdAttr<CommandRenameNX>("renamenx", 3, "write", 
1, 2, 1),
                         MakeCmdAttr<CommandCopy>("copy", -3, "write", 1, 2, 1),
-                        MakeCmdAttr<CommandSort<false>>("sort", -2, "write", 
1, 1, 1),
-                        MakeCmdAttr<CommandSort<true>>("sort_ro", -2, 
"read-only", 1, 1, 1))
+                        MakeCmdAttr<CommandSort<false>>("sort", -2, "write 
slow", 1, 1, 1),
+                        MakeCmdAttr<CommandSort<true>>("sort_ro", -2, 
"read-only slow", 1, 1, 1))
 
 }  // namespace redis
diff --git a/src/commands/cmd_search.cc b/src/commands/cmd_search.cc
index 7dbaa4af..88858558 100644
--- a/src/commands/cmd_search.cc
+++ b/src/commands/cmd_search.cc
@@ -481,7 +481,8 @@ class CommandFTDrop : public Commander {
 };
 
 REDIS_REGISTER_COMMANDS(Search,
-                        MakeCmdAttr<CommandFTCreate>("ft.create", -2, "write 
exclusive no-multi no-script", 0, 0, 0),
+                        MakeCmdAttr<CommandFTCreate>("ft.create", -2, "write 
exclusive no-multi no-script slow", 0, 0,
+                                                     0),
                         MakeCmdAttr<CommandFTSearchSQL>("ft.searchsql", -2, 
"read-only", 0, 0, 0),
                         MakeCmdAttr<CommandFTSearch>("ft.search", -3, 
"read-only", 0, 0, 0),
                         MakeCmdAttr<CommandFTExplainSQL>("ft.explainsql", -2, 
"read-only", 0, 0, 0),
diff --git a/src/commands/cmd_server.cc b/src/commands/cmd_server.cc
index 445f20d4..ded447ef 100644
--- a/src/commands/cmd_server.cc
+++ b/src/commands/cmd_server.cc
@@ -1331,7 +1331,7 @@ REDIS_REGISTER_COMMANDS(Server, 
MakeCmdAttr<CommandAuth>("auth", 2, "read-only o
                         MakeCmdAttr<CommandRole>("role", 1, "read-only 
ok-loading", 0, 0, 0),
                         MakeCmdAttr<CommandConfig>("config", -2, "read-only", 
0, 0, 0, GenerateConfigFlag),
                         MakeCmdAttr<CommandNamespace>("namespace", -3, 
"read-only", 0, 0, 0),
-                        MakeCmdAttr<CommandKeys>("keys", 2, "read-only", 0, 0, 
0),
+                        MakeCmdAttr<CommandKeys>("keys", 2, "read-only slow", 
0, 0, 0),
                         MakeCmdAttr<CommandFlushDB>("flushdb", 1, "write 
no-dbsize-check", 0, 0, 0),
                         MakeCmdAttr<CommandFlushAll>("flushall", 1, "write 
no-dbsize-check", 0, 0, 0),
                         MakeCmdAttr<CommandDBSize>("dbsize", -1, "read-only", 
0, 0, 0),
diff --git a/src/commands/cmd_set.cc b/src/commands/cmd_set.cc
index cc66c968..b2ed58e6 100644
--- a/src/commands/cmd_set.cc
+++ b/src/commands/cmd_set.cc
@@ -461,7 +461,7 @@ REDIS_REGISTER_COMMANDS(Set, 
MakeCmdAttr<CommandSAdd>("sadd", -3, "write", 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<CommandSRandMember>("srandmember", -2, 
"read-only slow", 1, 1, 1),
                         MakeCmdAttr<CommandSMove>("smove", 4, "write", 1, 2, 
1),
                         MakeCmdAttr<CommandSDiff>("sdiff", -2, "read-only 
slow", 1, -1, 1),
                         MakeCmdAttr<CommandSUnion>("sunion", -2, "read-only 
slow", 1, -1, 1),
diff --git a/src/commands/cmd_txn.cc b/src/commands/cmd_txn.cc
index fcd74e8f..41bc823f 100644
--- a/src/commands/cmd_txn.cc
+++ b/src/commands/cmd_txn.cc
@@ -120,7 +120,7 @@ class CommandUnwatch : public Commander {
 
 REDIS_REGISTER_COMMANDS(Txn, MakeCmdAttr<CommandMulti>("multi", 1, "multi", 0, 
0, 0),
                         MakeCmdAttr<CommandDiscard>("discard", 1, "multi", 0, 
0, 0),
-                        MakeCmdAttr<CommandExec>("exec", 1, "exclusive multi", 
0, 0, 0),
+                        MakeCmdAttr<CommandExec>("exec", 1, "exclusive multi 
slow", 0, 0, 0),
                         MakeCmdAttr<CommandWatch>("watch", -2, "multi", 1, -1, 
1),
                         MakeCmdAttr<CommandUnwatch>("unwatch", 1, "multi", 0, 
0, 0), )
 

Reply via email to