Unverified Commit 10bbeb68 authored by guybe7's avatar guybe7 Committed by GitHub
Browse files

Add command tips to COMMAND DOCS (#10104)

Adding command tips (see https://redis.io/topics/command-tips) to commands.

Breaking changes:
1. Removed the "random" and "sort_for_script" flags. They are now command tips.
(this isn't affecting redis behavior since #9812, but could affect some client applications
that's relying on COMMAND command flags)

Summary of changes:
1. add BLOCKING flag (new flag) for all commands that could block. The ACL category with
  the same name is now implicit.
2. move RANDOM flag to a `nondeterministic_output` tip
3. move SORT_FOR_SCRIPT flag to `nondeterministic_output_order` tip
3. add REQUEST_POLICY and RESPONSE_POLICY where appropriate as documented in the tips
4. deprecate (ignore) the `random` flag for RM_CreateCommand

Other notes:
1. Proxies need to send `RANDOMKEY` to all shards and then select one key randomly.
  The other option is to pick a random shard and transfer `RANDOMKEY `to it, but that scheme
  fails if this specific shard is empty
2. Remove CMD_RANDOM from `XACK` (i.e. XACK does not have RANDOM_OUTPUT)
   It was added in 9e4fb96c, I guess by mistake.
   Also from `(P)EXPIRETIME` (new command, was flagged "random" by mistake).
3. Add `nondeterministic_output` to `OBJECT ENCODING` (for the same reason `XTRIM` has it:
   the reply may differ depending on the internal representation in memory)
4. RANDOM on `HGETALL` was wrong (there due to a limitation of the old script sorting logic), now
  it's `nondeterministic_output_order`
5. Unrelated: Hide CMD_PROTECTED from COMMAND
parent 9c602922
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
"command_flags": [ "command_flags": [
"WRITE", "WRITE",
"DENYOOM", "DENYOOM",
"NOSCRIPT" "NOSCRIPT",
"BLOCKING"
], ],
"acl_categories": [ "acl_categories": [
"LIST", "LIST"
"BLOCKING"
], ],
"key_specs": [ "key_specs": [
{ {
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
"function": "blmpopCommand", "function": "blmpopCommand",
"get_keys_function": "blmpopGetKeys", "get_keys_function": "blmpopGetKeys",
"command_flags": [ "command_flags": [
"WRITE" "WRITE",
"BLOCKING"
], ],
"acl_categories": [ "acl_categories": [
"LIST", "LIST"
"BLOCKING"
], ],
"key_specs": [ "key_specs": [
{ {
......
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
], ],
"command_flags": [ "command_flags": [
"WRITE", "WRITE",
"NOSCRIPT" "NOSCRIPT",
"BLOCKING"
], ],
"acl_categories": [ "acl_categories": [
"LIST", "LIST"
"BLOCKING"
], ],
"key_specs": [ "key_specs": [
{ {
......
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
], ],
"command_flags": [ "command_flags": [
"WRITE", "WRITE",
"NOSCRIPT" "NOSCRIPT",
"BLOCKING"
], ],
"acl_categories": [ "acl_categories": [
"LIST", "LIST"
"BLOCKING"
], ],
"key_specs": [ "key_specs": [
{ {
......
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
"command_flags": [ "command_flags": [
"WRITE", "WRITE",
"DENYOOM", "DENYOOM",
"NOSCRIPT" "NOSCRIPT",
"BLOCKING"
], ],
"acl_categories": [ "acl_categories": [
"LIST", "LIST"
"BLOCKING"
], ],
"key_specs": [ "key_specs": [
{ {
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
"function": "bzmpopCommand", "function": "bzmpopCommand",
"get_keys_function": "blmpopGetKeys", "get_keys_function": "blmpopGetKeys",
"command_flags": [ "command_flags": [
"WRITE" "WRITE",
"BLOCKING"
], ],
"acl_categories": [ "acl_categories": [
"SORTEDSET", "SORTEDSET"
"BLOCKING"
], ],
"key_specs": [ "key_specs": [
{ {
......
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
"command_flags": [ "command_flags": [
"WRITE", "WRITE",
"NOSCRIPT", "NOSCRIPT",
"FAST" "FAST",
"BLOCKING"
], ],
"acl_categories": [ "acl_categories": [
"SORTEDSET", "SORTEDSET"
"BLOCKING"
], ],
"key_specs": [ "key_specs": [
{ {
......
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
"command_flags": [ "command_flags": [
"WRITE", "WRITE",
"NOSCRIPT", "NOSCRIPT",
"FAST" "FAST",
"BLOCKING"
], ],
"acl_categories": [ "acl_categories": [
"SORTEDSET", "SORTEDSET"
"BLOCKING"
], ],
"key_specs": [ "key_specs": [
{ {
......
...@@ -9,12 +9,14 @@ ...@@ -9,12 +9,14 @@
"function": "clientCommand", "function": "clientCommand",
"command_flags": [ "command_flags": [
"NOSCRIPT", "NOSCRIPT",
"RANDOM",
"LOADING", "LOADING",
"STALE" "STALE"
], ],
"acl_categories": [ "acl_categories": [
"CONNECTION" "CONNECTION"
],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
] ]
} }
} }
...@@ -24,13 +24,15 @@ ...@@ -24,13 +24,15 @@
"command_flags": [ "command_flags": [
"ADMIN", "ADMIN",
"NOSCRIPT", "NOSCRIPT",
"RANDOM",
"LOADING", "LOADING",
"STALE" "STALE"
], ],
"acl_categories": [ "acl_categories": [
"CONNECTION" "CONNECTION"
], ],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
],
"arguments": [ "arguments": [
{ {
"token": "TYPE", "token": "TYPE",
......
...@@ -10,9 +10,11 @@ ...@@ -10,9 +10,11 @@
"command_flags": [ "command_flags": [
"NO_ASYNC_LOADING", "NO_ASYNC_LOADING",
"ADMIN", "ADMIN",
"RANDOM",
"STALE" "STALE"
], ],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
],
"arguments": [ "arguments": [
{ {
"name": "slot", "name": "slot",
......
...@@ -10,9 +10,11 @@ ...@@ -10,9 +10,11 @@
"command_flags": [ "command_flags": [
"NO_ASYNC_LOADING", "NO_ASYNC_LOADING",
"ADMIN", "ADMIN",
"RANDOM",
"STALE" "STALE"
], ],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
],
"arguments": [ "arguments": [
{ {
"name": "start-slot_end-slot", "name": "start-slot_end-slot",
......
...@@ -10,8 +10,10 @@ ...@@ -10,8 +10,10 @@
"command_flags": [ "command_flags": [
"NO_ASYNC_LOADING", "NO_ASYNC_LOADING",
"ADMIN", "ADMIN",
"RANDOM",
"STALE" "STALE"
],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
] ]
} }
} }
...@@ -9,9 +9,11 @@ ...@@ -9,9 +9,11 @@
"function": "clusterCommand", "function": "clusterCommand",
"command_flags": [ "command_flags": [
"ADMIN", "ADMIN",
"RANDOM",
"STALE" "STALE"
], ],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
],
"arguments": [ "arguments": [
{ {
"name": "node-id", "name": "node-id",
......
...@@ -8,9 +8,11 @@ ...@@ -8,9 +8,11 @@
"container": "CLUSTER", "container": "CLUSTER",
"function": "clusterCommand", "function": "clusterCommand",
"command_flags": [ "command_flags": [
"RANDOM",
"STALE" "STALE"
], ],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
],
"arguments": [ "arguments": [
{ {
"name": "slot", "name": "slot",
......
...@@ -10,9 +10,11 @@ ...@@ -10,9 +10,11 @@
"command_flags": [ "command_flags": [
"NO_ASYNC_LOADING", "NO_ASYNC_LOADING",
"ADMIN", "ADMIN",
"RANDOM",
"STALE" "STALE"
], ],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
],
"arguments": [ "arguments": [
{ {
"name": "slot", "name": "slot",
......
...@@ -10,9 +10,11 @@ ...@@ -10,9 +10,11 @@
"command_flags": [ "command_flags": [
"NO_ASYNC_LOADING", "NO_ASYNC_LOADING",
"ADMIN", "ADMIN",
"RANDOM",
"STALE" "STALE"
], ],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
],
"arguments": [ "arguments": [
{ {
"name": "start-slot_end-slot", "name": "start-slot_end-slot",
......
...@@ -10,9 +10,11 @@ ...@@ -10,9 +10,11 @@
"command_flags": [ "command_flags": [
"NO_ASYNC_LOADING", "NO_ASYNC_LOADING",
"ADMIN", "ADMIN",
"RANDOM",
"STALE" "STALE"
], ],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
],
"arguments": [ "arguments": [
{ {
"name": "options", "name": "options",
......
...@@ -10,8 +10,10 @@ ...@@ -10,8 +10,10 @@
"command_flags": [ "command_flags": [
"NO_ASYNC_LOADING", "NO_ASYNC_LOADING",
"ADMIN", "ADMIN",
"RANDOM",
"STALE" "STALE"
],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
] ]
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment