-
Notifications
You must be signed in to change notification settings - Fork 23.8k
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
Allow clients to report name and version #11758
Conversation
- Add HELLO SETLIB [libname] [libver] subcommand - Add CLIENT SETLIB [libname] [libver] subcommand - Add CLIENT GETLIB subcommand - Add 'lib-name' and 'lib-ver' parameters to CLIENT LIST command output
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen some client (e.g. Lettuce) use the name field to indicate the client library and operation name=lettuce#ClusterTopologyRefresh
. Similarly, maybe they can add libname and version as prefix in the client name itself. What do you think about this @uglide ?
We'll invariably want to pack more (somehow) than name and version into the client connection details. Any chance we can also have some other string based field - something general purpose, for the client's user's need. |
I don't think the
I get:
which means I can't safely use This seems like a fundamental barrier to extending In theory I guess we could try to make
but that still doesn't help with the "what if you run that against a vToday server that doesn't know about that pattern", plus the result of |
I agree with @mgravell, One way to address that is to introduce |
Following some discussions, i wanna make the following proposal:
if we can agree on the semantics quickly, and have some degree of certainty that this design is future proof, we can probably implement it within a day or two! |
This was just discussed in a core-team meeting and was conceptually approved for 7.2 RC1 (next week). |
@oranagra My option for the new command name is |
In addition, I want to add a useful information is the
As an SDK developer, I suggest continuing to expand the
|
@yangbodong22011 we prefer one handshake command instead of extending CLIENT. |
For current requirements (allow client report name, version, ip), it is more suitable to be done in |
I agree it's not currently clear. We wanna make it clearer. |
That ship has already sailed. You already can't necessarily use HELLO, since you don't know the server version. The way we've side-stepped this is basically to pipeline all of HELLO, AUTH and CLIENT, which gets you to the right result regardless of the server, without needing to add latency. I do kinda agree that simply adding another CLIENT sub-command achieves the same aim without complications. And means we can just keep pipelining. |
i agree there's no practical difference between pipelining CLIENT commands and a HELLOEXT, but the later is cleaner IMHO. the CLIENT command is a set of very different sub-commands. If i could i would have extend HELLO, but since we can't, the next best thing is to add HELLO2*. |
@redis/core-team i implemented the changes we discussed and updated the top comment, please take a look |
@oranagra I'm not sure adding a bunch of commands on one vs. pipelining is actually cleaner. What happens in the exception case? Let's say the client supplies an incorrect field for something, will it throw? Does everything except that set? Does the entire command fail? What's the response the client gets to parse to figure out which subset of the commands succeeded or failed? I'd argue monolithic commands using a bunch of extensions for separate actions (e.g. setting each piece of metadata) has its own set of issues. If we pipelined Please reconsider extending client instead of setting some pieces of metadata in one spot, others in another, and both handled in very different ways due to the reasons above. |
@NickCraver First, what makes it cleaner is that we're trying to create some mechanism which designed and documented to be used for handshake, and trying to plan ahead and think of how it's gonna be extended. Secondly, as documented above, this new command is specifically aimed to pass metadata, or other arguments which are optional and the client shouldn't usually care if the server accepted them or rejected them. we won't use it for switching protocol or anything like that. these can be extensions to the HELLO command, or additional CLIENT sub-command like NO-TOUCH which we just added. For the purpose of discussion, i can argue that i agree with you and pipelining several is indeed cleaner, and it's just that i want a dedicated command for these metadata fields, rather than a sub-command of CLIENT. |
Good question. Looking at latest code, it looks to me like a client could choose to pipeline For the moment, the best suggestion I have is calling it something like My overall suggestion would be to classify this as what it is: client metadata, but not Let me just say I really appreciate both the back and forth and willingness to adjust as things as they go in across the board here. It makes me so happy that a ton of care is being taken to get these set-in-stone things as good as possible and that's awesome. Cheers! |
we certainly wanna take the time to make the right decision here, and not just add something we may later regret. I think the key differences between the fact that it is variadic or not, is not that critical, specifically if it's just metadata, people can just call it multiple times. if it's a handshake, it might be more important to be variadic, but actually the fact we said each of the tuples can be accepted / handled separately, means that they're already meant to be independent. what i do like about both approaches, is that it's one (or sub) command that handles it all in one place (better for clarity and documentation). when i was thinking of a HELLO extension with non-binding arguments (in which the command would succeed even if some are unsupported), i was also thinking on non-metadata features, ones that do not change anything significant like breaking the protocol / app (reminds me of possix_fadvise). Maybe CLIENT NO-TOUCH does fit into that category in some cases (i.e. for anyway, i think this should be the focus of discussion here (metadata only, vs other client specific setting), i'm not certain i see exactly what we wanna do with it, but i do wanna try to plan ahead and avoid any future regrets, breaking changes, or awkward / messy API. that's why i wanted to introduce a command that's flexible and a little bit vague. |
Agreed! FWIW, I think
On the above: what would help me a ton is any examples of non-metadata on the table for the future - are there some y'all have discussed? I'm having trouble coming up with any and that's certainly framing current thoughts around it. |
we discussed this in the core-team and we lean towards we're on the fence regarding let's have a quick async discussion around that and move forward... |
@oranagra I think that makes a lot of sense - if we don't have some concrete use cases then best to leave it off and not guess. I have some ideas of how it'd be used, basically what is the app environment: dev/stage/prod, or the environment name, or state...lots of variety, but those may be something few others share. I'm curious what others picture as the environment and if it matters that much - the client name is generally the role/system which is unique and mappable to those environments in most cases so it may be entirely superfluous to include. Generally speaking, I'd imagine a lot of the Redis servers that are being connected to are per-environment anyway, with global type of things being the exception to that rule. Super curious what others had in mind there if anything, just adding some thoughts for down the road :) |
Agree, just share some remote-ip actual scenarios:
If more users are facing the same problem and feedback in this comment, then we can consider a separate PR to do this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Random comment change, but I'm happy with the API and how it functions.
Co-authored-by: Madelyn Olson <[email protected]>
The sanity check test intention was to detect that when a command is added to sentinel it is on purpose. This test is easily broken, like CLIENT SETINFO introduced by redis#11758. We replace it with a test that validates that a few specific commands are either there or missing (to test the infrastructure works correctly).
…11950) The sanity check test intention was to detect that when a command is added to sentinel it is on purpose. This test is easily broken, like CLIENT SETINFO introduced by #11758. We replace it with a test that validates that a few specific commands are either there or missing (to test the infrastructure works correctly).
Added missing needs:reset tag. Introduced by #11758
Includes: - ConfigurationOptions (to opt-opt) - handshake (to send) - release notes - configuration documentation note we can't validate this yet as not on any released servers most contentious point: what lib-name to use - I've gone with `SE.Redis`, but: happy to use `StackExchange.Redis` if people prefer; I'm *not* aiming to make the name configurable cross-reference: redis/redis#11758 Co-authored-by: Nick Craver <[email protected]>
This PR allows clients to send information about the client library to redis to be displayed in CLIENT LIST and CLIENT INFO.
Currently supports:
CLIENT [lib-name | lib-ver] <value>
Client libraries are expected to pipeline these right after AUTH, and ignore the failure in case they're talking to an older version of redis.
These will be shown in CLIENT LIST and CLIENT INFO as:
lib-name
- meant to hold the client library name.lib-ver
- meant to hold the client library version.The values cannot contain spaces, newlines and any wild ASCII characters, but all other normal chars are accepted, e.g
.
,=
etc (same as CLIENT NAME).The RESET command does NOT clear these, but they can be cleared to the default by sending a command with a blank string.
Docs PR: redis/redis-doc#2362