caipengbo commented on code in PR #2173:
URL: https://github.com/apache/kvrocks/pull/2173#discussion_r1527440599
##########
src/commands/cmd_cluster.cc:
##########
@@ -292,8 +292,25 @@ static uint64_t GenerateClusterFlag(const
std::vector<std::string> &args) {
return 0;
}
+class CommandReadOnly : public Commander {
+ public:
+ Status Execute(Server *srv, Connection *conn, std::string *output) override {
+ *output = redis::SimpleString("READONLY");
Review Comment:
The reply should be `OK`.
##########
src/commands/cmd_cluster.cc:
##########
@@ -292,8 +292,25 @@ static uint64_t GenerateClusterFlag(const
std::vector<std::string> &args) {
return 0;
}
+class CommandReadOnly : public Commander {
+ public:
+ Status Execute(Server *srv, Connection *conn, std::string *output) override {
+ *output = redis::SimpleString("READONLY");
+ return srv->cluster->SetClusterMode(Cluster::ClusterMode::READONLY);
+ }
+};
+
+class CommandReadWrite : public Commander {
+ public:
+ Status Execute(Server *srv, Connection *conn, std::string *output) override {
+ *output = redis::SimpleString("READWRITE");
Review Comment:
The reply should be `OK`.
--
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]