-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Add command tips to COMMAND DOCS #10104
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
Conversation
Others: 1. Remove CMD_RANDOM from XACK (i.e. XACK is does not have RANDOM_OUTPUT) It was added in 9e4fb96, I guess by mistake. Also from (P)EXPIRETIME (new command, was flagged random by mistake). 2. Add "random-output" to OBJECT ENCODING (for the same reason XTRIM has it: the reply may differ depending on the internal representation in memory)
|
@redis/core-team please review / approve / comment. |
|
@oranagra @guybe7 Note: there are some comments in the documentation which, once resolved, should probably be reflected here. |
|
|
@soloestoy i think both can be used by some applications or frameworks (to know if the same command on the same data set can produce different results). |
|
@oranagra not sure if I can find some real use cases, but I'm a little confused with what you said, I remember the original intention of the refactoring of |
|
i'm sure some parts of the old COMMAND command are widely used (like other parts have changes which are just the reality (e.g. we could have delete some flag if it no longer makes sense, and the commands that used it can no longer be flagged that way). i don't think there are such changes in the flags, but there could be. lastly, in some cases we introduce potentially breaking changes, in order to solve bugs or reduce tech debt (like #10095). so it's a compromise between trying not to break anything that's being used, and fixing things to be better for future generations. |
|
We discussed this in a core-team meeting and concluded that the RANDOM and BLOCKING flags should move from the tip to the command flags. These are arguably flags that describe the redis command (what redis does), and not just how clients should handle it. We should let modules define both flags. Note that the RANDOM flag was there in the past, moving it could be considered a blocking change (probably not affecting many), but we're arguing that it may be better to keep it there anyway. |
- Let modules define both - expose both in COMMAND command flags
|
i've pushed that change (didn't update the top comment yet). |
|
@soloestoy please respond ^^. i agree that redis may some day decide to rely on the BLOCKING flag, but i'm not sure about the RANDOM flag. |
|
the reasoning for keeping if indeed we are worried about BC we should have all three (random, random_order, and blocking) as flags. side note: if if we don't think BC is an issues here I think that |
i'm leaning towards that. i don't think there are many (or any) users who used this flag, and i don't think it belongs in the flags field. |
|
Personally, fwiw, I'm unaware of any clients/frameworks that rely on these flags, so backward compatibility, in this case, is less than crucial imo. |
src/commands/config-set.json
Outdated
| "STALE" | ||
| ], | ||
| "command_tips": [ | ||
| "REQUEST_POLICY:ALL_SHARDS", |
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 would expect this to be something like "ALL_NODES" instead of "ALL_SHARDS", since you also want to set it on replicas.
|
Firstly I think we can analyze why clients need to use command flags
Beside whether it is a breaking change or not, I think |
|
decisions from discussion with @yossigo and @oranagra :
|
|
Adding to @guybe7's note above, I'll clarify what was the rationale behind some of these decisions:
|
|
i prefer |
|
The last few commits handle #10104 (comment) |
|
ALL_NODES commands: ALL_MASTERS commands: MULTI_SHARD commands: |
|
maybe SCRIPT LOAD and SCRIPT FLUSH should be ALL_NODES? |
madolson
left a comment
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.
Generally approved. I would prefer to not include the term MASTER as part of any type of contract moving forward, given that people will ask about it.
Fix #9876
Adding command tips (see https://redis.io/topics/command-tips / topics/command-tips.md) to commands.
Breaking changes:
Summary of changes:
nondeterministic_outputtipnondeterministic_output_ordertiprandomflag for RM_CreateCommandOther notes:
RANDOMKEYto all shards and then select one key randomly. The other option is to pick a random shard and transferRANDOMKEYto it, but that scheme fails if this specific shard is emptyXACK(i.e. XACK does not have RANDOM_OUTPUT)It was added in 9e4fb96, I guess by mistake.
Also from
(P)EXPIRETIME(new command, was flagged "random" by mistake).nondeterministic_outputtoOBJECT ENCODING(for the same reasonXTRIMhas it:the reply may differ depending on the internal representation in memory)
HGETALLwas wrong (there due to a limitation of the old script sorting logic), now it'snondeterministic_output_order