Skip to content

Commit

Permalink
Add redis_mode field in INFO SERVER
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 manger will need this field to determine
whether it is cluster mode.

If cluster mode is enabled, redis_mode is displayed as cluster,
otherwise it is standalone.

Fixes apache#1926.
  • Loading branch information
enjoy-binbin committed Dec 8, 2023
1 parent 6cb5b3a commit 3d8c320
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/server/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,7 @@ 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 << "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 3d8c320

Please sign in to comment.