Skip to content

Commit 714a6d3

Browse files
enjoy-binbingit-hulk
authored andcommitted
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.
1 parent 6d1571d commit 714a6d3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/server/server.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,8 @@ void Server::GetServerInfo(std::string *info) {
845845
string_stream << "redis_version:" << REDIS_VERSION << "\r\n";
846846
string_stream << "git_sha1:" << GIT_COMMIT << "\r\n";
847847
string_stream << "kvrocks_git_sha1:" << GIT_COMMIT << "\r\n";
848+
string_stream << "redis_mode:" << (config_->cluster_enabled ? "cluster" : "standalone") << "\r\n";
849+
string_stream << "kvrocks_mode:" << (config_->cluster_enabled ? "cluster" : "standalone") << "\r\n";
848850
string_stream << "os:" << name.sysname << " " << name.release << " " << name.machine << "\r\n";
849851
#ifdef __GNUC__
850852
string_stream << "gcc_version:" << __GNUC__ << "." << __GNUC_MINOR__ << "." << __GNUC_PATCHLEVEL__ << "\r\n";

0 commit comments

Comments
 (0)