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

Support the hello command #753

Closed
1 of 2 tasks
git-hulk opened this issue Jul 25, 2022 · 8 comments
Closed
1 of 2 tasks

Support the hello command #753

git-hulk opened this issue Jul 25, 2022 · 8 comments
Labels
enhancement type enhancement good first issue Good for newcomers

Comments

@git-hulk
Copy link
Member

Search before asking

  • I had searched in the issues and found no similar issues.

Motivation

Redis supported the hello command to detect the different protocol and some Redis SDKs will
use it to switch a different protocol. So it will be good to support the command to make those
SDKs happy.

Solution

Add the hello command and keep the output same with https://redis.io/commands/hello/

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@git-hulk git-hulk added enhancement type enhancement good first issue Good for newcomers labels Jul 25, 2022
@mapleFU
Copy link
Member

mapleFU commented Aug 18, 2022

Hi hulk, after reading document and code of redis (mainly https://github.com/redis/redis/blob/unstable/src/networking.c#L3432 ), I found that hello defines the protocol redis use ( RESP2 or RESP3), and return the data via hello's "protocol".

After go through the code of kvrocks ( redis_cmd and server ), I didn't found implementions for RESP3, did I miss it?

@git-hulk
Copy link
Member Author

@mapleFU You're right that we only implemented RESP2 and have no plan to implement RESP3 recently. The main purpose of this command is to compatible with some Redis clients, which may send the hello command to check the protocol version after connecting to the server.

@mapleFU
Copy link
Member

mapleFU commented Aug 18, 2022

@mapleFU You're right that we only implemented RESP2 and have no plan to implement RESP3 recently. The main purpose of this command is to compatible with some Redis clients, which may send the hello command to check the protocol version after connecting to the server.

So, user should get response like https://github.com/redis/redis/blob/unstable/src/networking.c#L3439 if they use protocol as 3? What about acl?

@git-hulk
Copy link
Member Author

@mapleFU You're right that we only implemented RESP2 and have no plan to implement RESP3 recently. The main purpose of this command is to compatible with some Redis clients, which may send the hello command to check the protocol version after connecting to the server.

So, user should get response like https://github.com/redis/redis/blob/unstable/src/networking.c#L3439 if they use protocol as 3? What about acl?

Yes, can respond the protocol version is out of range like Redis. For the ACL, we don't support the user/password like Redis 6/7, so I think we can just read ignore the AUTH parameters. That said those clients must use legacy way to auth.

@tisonkun
Copy link
Member

tisonkun commented Sep 6, 2022

It's interesting that when executing HELLO 3 AUTH default foobar with requirepass foobar Kvrocks returns "NOAUTH Authentication required." instead of ERR unknown command so that some assumption made by go-redis doesn't work.

cc @vmihailenco this can be an incompatible issue with Kvrocks and go-redis, but I suppose it should be resolved by Kvrocks support HELLO or at least returns ERR unknown command on unknown command.

@git-hulk
Copy link
Member Author

git-hulk commented Sep 6, 2022

Good catch. I think the right behavior should return ERR unknown command on Kvrock's side, but unfortunately that Kvrocks will check the auth first now.

@tisonkun
Copy link
Member

tisonkun commented Sep 6, 2022

@git-hulk I change the order in #830 and all tests look good.

@git-hulk
Copy link
Member Author

git-hulk commented Sep 6, 2022

@git-hulk I change the order in #830 and all tests look good.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement type enhancement good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants