PragmaTwice commented on code in PR #2272:
URL: https://github.com/apache/kvrocks/pull/2272#discussion_r1582008204


##########
src/cluster/cluster.cc:
##########
@@ -53,10 +53,10 @@ Cluster::Cluster(Server *srv, std::vector<std::string> 
binds, int port)
 // cluster data, so these commands should be executed exclusively, and 
ReadWriteLock
 // also can guarantee accessing data is safe.
 bool Cluster::SubCommandIsExecExclusive(const std::string &subcommand) {
-  for (auto v : {"setnodes", "setnodeid", "setslot", "import", "reset"}) {
-    if (util::EqualICase(v, subcommand)) return true;
-  }
-  return false;
+  static std::vector<std::string> values = {"setnodes", "setnodeid", 
"setslot", "import", "reset"};

Review Comment:
   This `static` will bring a lock to this function. Please remove it.



-- 
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]

Reply via email to