This is an automated email from the ASF dual-hosted git repository.
hulk pushed a commit to branch 2.7
in repository https://gitbox.apache.org/repos/asf/kvrocks.git
The following commit(s) were added to refs/heads/2.7 by this push:
new 714a6d30 Add redis_mode/kvrocks_mode fields in INFO SERVER (#1927)
714a6d30 is described below
commit 714a6d30bc14df77e64f03ce2e645d3bd8614ad0
Author: Binbin <[email protected]>
AuthorDate: Fri Dec 8 17:41:28 2023 +0800
Add redis_mode/kvrocks_mode fields in INFO SERVER (#1927)
Although we will already show cluster_enabled in INFO CLUSTER,
some tools such as Redis Manager will need this field to determine
whether it is cluster mode.
If cluster mode is enabled, redis_mode is displayed as a cluster,
otherwise, it is standalone. We also use this opportunity to add
a kvrocks_mode field.
Fixes #1926.
---
src/server/server.cc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/server/server.cc b/src/server/server.cc
index 2e4a83b9..2dc53082 100644
--- a/src/server/server.cc
+++ b/src/server/server.cc
@@ -845,6 +845,8 @@ void Server::GetServerInfo(std::string *info) {
string_stream << "redis_version:" << REDIS_VERSION << "\r\n";
string_stream << "git_sha1:" << GIT_COMMIT << "\r\n";
string_stream << "kvrocks_git_sha1:" << GIT_COMMIT << "\r\n";
+ string_stream << "redis_mode:" << (config_->cluster_enabled ? "cluster" :
"standalone") << "\r\n";
+ string_stream << "kvrocks_mode:" << (config_->cluster_enabled ? "cluster" :
"standalone") << "\r\n";
string_stream << "os:" << name.sysname << " " << name.release << " " <<
name.machine << "\r\n";
#ifdef __GNUC__
string_stream << "gcc_version:" << __GNUC__ << "." << __GNUC_MINOR__ << "."
<< __GNUC_PATCHLEVEL__ << "\r\n";