Skip to content

Commit

Permalink
Add redis_mode/kvrocks_mode fields in INFO SERVER (#1927)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
enjoy-binbin authored and git-hulk committed Dec 8, 2023
1 parent 6d1571d commit 714a6d3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/server/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 714a6d3

Please sign in to comment.