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

fix: hello command not return information of pika version #2990

Open
wants to merge 1 commit into
base: 3.5
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions src/pika_admin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3303,8 +3303,11 @@ void HelloCmd::Do() {
}

std::string raw;
char version[32];
snprintf(version, sizeof(version), "%d.%d.%d", PIKA_MAJOR, PIKA_MINOR, PIKA_PATCH);
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个version值本身有没有含义?比如version大于某个值,client的使用方式会不同?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

version大于7.2会调用CLIENT SETINFO去设置“lib-name"和"lib-ver"。
image
同时,我查了一下,对于没有修改的版本,如果使用lettuce进行连接的时候遇到”version must not be null“ 的问题,可以在配置类中指定lettuce使用RESP2进行连接,这样lettuce就不会调用hello来进行连接。
redis/lettuce#2350 (comment)

Copy link
Collaborator

Choose a reason for hiding this comment

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

大概看了下redis 大版本的介绍,这里我们就设置5.0.0吧。

std::vector<storage::FieldValue> fvs{
{"server", "redis"},
{"version", version}
};
// just for redis resp2 protocol
fvs.push_back({"proto", "2"});
Expand Down
Loading