Follow https://github.com/antirez/redis/pull/7363.
While that pr fixed the proto version returned, it is almost meaningless. Because HELLO will always switch the proto to the specified one.
Furthermore, if redis, say 7.0, sets RESP3 to the default proto, then HELLO 2 will switch the proto. And it does not do what the document say anymore:
command also works with "2" as argument, ...., just to get the reply from the server without switching the protocol
I prefer to use HELLO -1 to get the reply without switching the protocol. But simply HELLO also works. What do you think about that?
Comment From: itamarhaber
Hello @xhebox :)
Thanks for the PR - I think it is a good fix and far from meaningless.
As you've noted, the docs will need to be changed - perhaps make a PR for that too?
I agree with the need to have a "read-only" variant of HELLO, and would rather have the protocol version argument optional. I don't think this change will break something terribly, but let's wait for the developers to provide their analysis and thoughts on the matter.
Comment From: antirez
Hello, I think that "HELLO" alone just replying with the dictionary could be a good idea indeed. However there is this problem: if the server is authenticated, we can't just say "HELLO", because there is the AUTH option that is needed as well. So maybe HELLO should work, and similarly "HELLO 0" should work (I don't like -1 a lot, 0 should be fine), so that it's even possible to use "HELLO 0 AUTH ..." to just accept whatever the server default protocol is.
Comment From: xhebox
Indeed, it is quite annoying to recalculate the offset. Here is the PR introducing HELLO 0.
And I think this issue should not be closed before the PR on redis-io/documentation is merged.
Comment From: xhebox
@itamarhaber A gentle ping :)
Comment From: madolson
Looking at the command definition:
HELLO protover [AUTH username password] [SETNAME clientname]
We should be able to detect whether or not the second argument is an integer, or the start of the optional arguments. So, we should be able to just support HELLO as a standalone command.