Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the compatible Redis version to the info command #1158

Merged
merged 5 commits into from
Dec 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/server/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include "worker.h"

std::atomic<int> Server::unix_time_ = {0};
constexpr const char *REDIS_VERSION = "4.0.0";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, does it mean that we're functionality compatible with Redis 4.x?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we support STREAM delivered in Redis 5.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we are roughly aligning the protocol with the Redis 4.x, but the data type and command can be newer than 4.x.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also think in the future there will be some commands that only kvrocks has but redis doesn't


Server::Server(Engine::Storage *storage, Config *config) : storage_(storage), config_(config) {
// init commands stats here to prevent concurrent insert, and cause core
Expand Down Expand Up @@ -783,6 +784,7 @@ void Server::GetServerInfo(std::string *info) {
time(&now);
string_stream << "# Server\r\n";
string_stream << "version:" << VERSION << "\r\n";
xiaobiaozhao marked this conversation as resolved.
Show resolved Hide resolved
string_stream << "redis_version:" << REDIS_VERSION << "\r\n";
string_stream << "git_sha1:" << GIT_COMMIT << "\r\n";
string_stream << "os:" << name.sysname << " " << name.release << " " << name.machine << "\r\n";
#ifdef __GNUC__
Expand Down