This is an automated email from the ASF dual-hosted git repository.
hulk 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 1b18b792 Unified the leading `k` in connection flags (#2260)
1b18b792 is described below
commit 1b18b792e1e2fb476b8d8952e2f018db392bc7c5
Author: anotherJJz <[email protected]>
AuthorDate: Sat Apr 20 22:40:13 2024 +0800
Unified the leading `k` in connection flags (#2260)
---
src/cluster/cluster.cc | 2 +-
src/commands/cmd_cluster.cc | 4 ++--
src/server/redis_connection.h | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/cluster/cluster.cc b/src/cluster/cluster.cc
index 72a7f15a..ed393078 100644
--- a/src/cluster/cluster.cc
+++ b/src/cluster/cluster.cc
@@ -863,7 +863,7 @@ Status Cluster::CanExecByMySelf(const
redis::CommandAttributes *attributes, cons
if (myself_ && myself_->role == kClusterSlave && !(attributes->flags &
redis::kCmdWrite) &&
nodes_.find(myself_->master_id) != nodes_.end() &&
nodes_[myself_->master_id] == slots_nodes_[slot] &&
- conn->IsFlagEnabled(redis::Connection::KReadOnly)) {
+ conn->IsFlagEnabled(redis::Connection::kReadOnly)) {
return Status::OK(); // My master is serving this slot
}
diff --git a/src/commands/cmd_cluster.cc b/src/commands/cmd_cluster.cc
index 04382ac1..df0c45ef 100644
--- a/src/commands/cmd_cluster.cc
+++ b/src/commands/cmd_cluster.cc
@@ -317,7 +317,7 @@ class CommandReadOnly : public Commander {
public:
Status Execute(Server *srv, Connection *conn, std::string *output) override {
*output = redis::SimpleString("OK");
- conn->EnableFlag(redis::Connection::KReadOnly);
+ conn->EnableFlag(redis::Connection::kReadOnly);
return Status::OK();
}
};
@@ -326,7 +326,7 @@ class CommandReadWrite : public Commander {
public:
Status Execute(Server *srv, Connection *conn, std::string *output) override {
*output = redis::SimpleString("OK");
- conn->DisableFlag(redis::Connection::KReadOnly);
+ conn->DisableFlag(redis::Connection::kReadOnly);
return Status::OK();
}
};
diff --git a/src/server/redis_connection.h b/src/server/redis_connection.h
index 79b9dd18..c206a158 100644
--- a/src/server/redis_connection.h
+++ b/src/server/redis_connection.h
@@ -45,7 +45,7 @@ class Connection : public EvbufCallbackBase<Connection> {
kCloseAfterReply = 1 << 6,
kCloseAsync = 1 << 7,
kMultiExec = 1 << 8,
- KReadOnly = 1 << 9,
+ kReadOnly = 1 << 9,
};
explicit Connection(bufferevent *bev, Worker *owner);