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 8ae7d54a Add redis_mode/kvrocks_mode fields in INFO SERVER (#1927)
8ae7d54a is described below

commit 8ae7d54a78d956642cc417f8b8d845f48866bfc4
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";

Reply via email to