Skip to content

Commit

Permalink
Remove the NONDETERMINISTIC_OUTPUT flag from most CLUSTER sub-command…
Browse files Browse the repository at this point in the history
…s. (redis#11157)

TLDR: the CLUSTER command originally had the `random` flag,
so all the sub-commands initially got that new flag, but in fact many
of them don't need it.
The only effect of this change is on the output of COMMAND INFO.

(cherry picked from commit a7da747)
  • Loading branch information
huangzhw authored and oranagra committed Sep 21, 2022
1 parent c900a49 commit 04bdb16
Show file tree
Hide file tree
Showing 17 changed files with 16 additions and 112 deletions.
80 changes: 16 additions & 64 deletions src/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,7 @@ struct redisCommandArg SETBIT_Args[] = {
#define CLUSTER_ADDSLOTS_History NULL

/* CLUSTER ADDSLOTS tips */
const char *CLUSTER_ADDSLOTS_tips[] = {
"nondeterministic_output",
NULL
};
#define CLUSTER_ADDSLOTS_tips NULL

/* CLUSTER ADDSLOTS argument table */
struct redisCommandArg CLUSTER_ADDSLOTS_Args[] = {
Expand All @@ -246,10 +243,7 @@ struct redisCommandArg CLUSTER_ADDSLOTS_Args[] = {
#define CLUSTER_ADDSLOTSRANGE_History NULL

/* CLUSTER ADDSLOTSRANGE tips */
const char *CLUSTER_ADDSLOTSRANGE_tips[] = {
"nondeterministic_output",
NULL
};
#define CLUSTER_ADDSLOTSRANGE_tips NULL

/* CLUSTER ADDSLOTSRANGE start_slot_end_slot argument table */
struct redisCommandArg CLUSTER_ADDSLOTSRANGE_start_slot_end_slot_Subargs[] = {
Expand Down Expand Up @@ -298,10 +292,7 @@ struct redisCommandArg CLUSTER_COUNT_FAILURE_REPORTS_Args[] = {
#define CLUSTER_COUNTKEYSINSLOT_History NULL

/* CLUSTER COUNTKEYSINSLOT tips */
const char *CLUSTER_COUNTKEYSINSLOT_tips[] = {
"nondeterministic_output",
NULL
};
#define CLUSTER_COUNTKEYSINSLOT_tips NULL

/* CLUSTER COUNTKEYSINSLOT argument table */
struct redisCommandArg CLUSTER_COUNTKEYSINSLOT_Args[] = {
Expand All @@ -315,10 +306,7 @@ struct redisCommandArg CLUSTER_COUNTKEYSINSLOT_Args[] = {
#define CLUSTER_DELSLOTS_History NULL

/* CLUSTER DELSLOTS tips */
const char *CLUSTER_DELSLOTS_tips[] = {
"nondeterministic_output",
NULL
};
#define CLUSTER_DELSLOTS_tips NULL

/* CLUSTER DELSLOTS argument table */
struct redisCommandArg CLUSTER_DELSLOTS_Args[] = {
Expand All @@ -332,10 +320,7 @@ struct redisCommandArg CLUSTER_DELSLOTS_Args[] = {
#define CLUSTER_DELSLOTSRANGE_History NULL

/* CLUSTER DELSLOTSRANGE tips */
const char *CLUSTER_DELSLOTSRANGE_tips[] = {
"nondeterministic_output",
NULL
};
#define CLUSTER_DELSLOTSRANGE_tips NULL

/* CLUSTER DELSLOTSRANGE start_slot_end_slot argument table */
struct redisCommandArg CLUSTER_DELSLOTSRANGE_start_slot_end_slot_Subargs[] = {
Expand All @@ -356,10 +341,7 @@ struct redisCommandArg CLUSTER_DELSLOTSRANGE_Args[] = {
#define CLUSTER_FAILOVER_History NULL

/* CLUSTER FAILOVER tips */
const char *CLUSTER_FAILOVER_tips[] = {
"nondeterministic_output",
NULL
};
#define CLUSTER_FAILOVER_tips NULL

/* CLUSTER FAILOVER options argument table */
struct redisCommandArg CLUSTER_FAILOVER_options_Subargs[] = {
Expand All @@ -380,21 +362,15 @@ struct redisCommandArg CLUSTER_FAILOVER_Args[] = {
#define CLUSTER_FLUSHSLOTS_History NULL

/* CLUSTER FLUSHSLOTS tips */
const char *CLUSTER_FLUSHSLOTS_tips[] = {
"nondeterministic_output",
NULL
};
#define CLUSTER_FLUSHSLOTS_tips NULL

/********** CLUSTER FORGET ********************/

/* CLUSTER FORGET history */
#define CLUSTER_FORGET_History NULL

/* CLUSTER FORGET tips */
const char *CLUSTER_FORGET_tips[] = {
"nondeterministic_output",
NULL
};
#define CLUSTER_FORGET_tips NULL

/* CLUSTER FORGET argument table */
struct redisCommandArg CLUSTER_FORGET_Args[] = {
Expand Down Expand Up @@ -445,10 +421,7 @@ NULL
#define CLUSTER_KEYSLOT_History NULL

/* CLUSTER KEYSLOT tips */
const char *CLUSTER_KEYSLOT_tips[] = {
"nondeterministic_output",
NULL
};
#define CLUSTER_KEYSLOT_tips NULL

/* CLUSTER KEYSLOT argument table */
struct redisCommandArg CLUSTER_KEYSLOT_Args[] = {
Expand Down Expand Up @@ -476,10 +449,7 @@ commandHistory CLUSTER_MEET_History[] = {
};

/* CLUSTER MEET tips */
const char *CLUSTER_MEET_tips[] = {
"nondeterministic_output",
NULL
};
#define CLUSTER_MEET_tips NULL

/* CLUSTER MEET argument table */
struct redisCommandArg CLUSTER_MEET_Args[] = {
Expand All @@ -495,10 +465,7 @@ struct redisCommandArg CLUSTER_MEET_Args[] = {
#define CLUSTER_MYID_History NULL

/* CLUSTER MYID tips */
const char *CLUSTER_MYID_tips[] = {
"nondeterministic_output",
NULL
};
#define CLUSTER_MYID_tips NULL

/********** CLUSTER NODES ********************/

Expand Down Expand Up @@ -534,10 +501,7 @@ struct redisCommandArg CLUSTER_REPLICAS_Args[] = {
#define CLUSTER_REPLICATE_History NULL

/* CLUSTER REPLICATE tips */
const char *CLUSTER_REPLICATE_tips[] = {
"nondeterministic_output",
NULL
};
#define CLUSTER_REPLICATE_tips NULL

/* CLUSTER REPLICATE argument table */
struct redisCommandArg CLUSTER_REPLICATE_Args[] = {
Expand All @@ -551,10 +515,7 @@ struct redisCommandArg CLUSTER_REPLICATE_Args[] = {
#define CLUSTER_RESET_History NULL

/* CLUSTER RESET tips */
const char *CLUSTER_RESET_tips[] = {
"nondeterministic_output",
NULL
};
#define CLUSTER_RESET_tips NULL

/* CLUSTER RESET hard_soft argument table */
struct redisCommandArg CLUSTER_RESET_hard_soft_Subargs[] = {
Expand All @@ -575,21 +536,15 @@ struct redisCommandArg CLUSTER_RESET_Args[] = {
#define CLUSTER_SAVECONFIG_History NULL

/* CLUSTER SAVECONFIG tips */
const char *CLUSTER_SAVECONFIG_tips[] = {
"nondeterministic_output",
NULL
};
#define CLUSTER_SAVECONFIG_tips NULL

/********** CLUSTER SET_CONFIG_EPOCH ********************/

/* CLUSTER SET_CONFIG_EPOCH history */
#define CLUSTER_SET_CONFIG_EPOCH_History NULL

/* CLUSTER SET_CONFIG_EPOCH tips */
const char *CLUSTER_SET_CONFIG_EPOCH_tips[] = {
"nondeterministic_output",
NULL
};
#define CLUSTER_SET_CONFIG_EPOCH_tips NULL

/* CLUSTER SET_CONFIG_EPOCH argument table */
struct redisCommandArg CLUSTER_SET_CONFIG_EPOCH_Args[] = {
Expand All @@ -603,10 +558,7 @@ struct redisCommandArg CLUSTER_SET_CONFIG_EPOCH_Args[] = {
#define CLUSTER_SETSLOT_History NULL

/* CLUSTER SETSLOT tips */
const char *CLUSTER_SETSLOT_tips[] = {
"nondeterministic_output",
NULL
};
#define CLUSTER_SETSLOT_tips NULL

/* CLUSTER SETSLOT subcommand argument table */
struct redisCommandArg CLUSTER_SETSLOT_subcommand_Subargs[] = {
Expand Down
3 changes: 0 additions & 3 deletions src/commands/cluster-addslots.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
"ADMIN",
"STALE"
],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
],
"arguments": [
{
"name": "slot",
Expand Down
3 changes: 0 additions & 3 deletions src/commands/cluster-addslotsrange.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
"ADMIN",
"STALE"
],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
],
"arguments": [
{
"name": "start-slot_end-slot",
Expand Down
3 changes: 0 additions & 3 deletions src/commands/cluster-countkeysinslot.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
"command_flags": [
"STALE"
],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
],
"arguments": [
{
"name": "slot",
Expand Down
3 changes: 0 additions & 3 deletions src/commands/cluster-delslots.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
"ADMIN",
"STALE"
],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
],
"arguments": [
{
"name": "slot",
Expand Down
3 changes: 0 additions & 3 deletions src/commands/cluster-delslotsrange.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
"ADMIN",
"STALE"
],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
],
"arguments": [
{
"name": "start-slot_end-slot",
Expand Down
3 changes: 0 additions & 3 deletions src/commands/cluster-failover.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
"ADMIN",
"STALE"
],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
],
"arguments": [
{
"name": "options",
Expand Down
3 changes: 0 additions & 3 deletions src/commands/cluster-flushslots.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
"NO_ASYNC_LOADING",
"ADMIN",
"STALE"
],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
]
}
}
3 changes: 0 additions & 3 deletions src/commands/cluster-forget.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
"ADMIN",
"STALE"
],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
],
"arguments": [
{
"name": "node-id",
Expand Down
3 changes: 0 additions & 3 deletions src/commands/cluster-keyslot.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
"command_flags": [
"STALE"
],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
],
"arguments": [
{
"name": "key",
Expand Down
3 changes: 0 additions & 3 deletions src/commands/cluster-meet.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
"ADMIN",
"STALE"
],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
],
"arguments": [
{
"name": "ip",
Expand Down
3 changes: 0 additions & 3 deletions src/commands/cluster-myid.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
"function": "clusterCommand",
"command_flags": [
"STALE"
],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
]
}
}
3 changes: 0 additions & 3 deletions src/commands/cluster-replicate.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
"ADMIN",
"STALE"
],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
],
"arguments": [
{
"name": "node-id",
Expand Down
3 changes: 0 additions & 3 deletions src/commands/cluster-reset.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
"STALE",
"NOSCRIPT"
],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
],
"arguments": [
{
"name": "hard_soft",
Expand Down
3 changes: 0 additions & 3 deletions src/commands/cluster-saveconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
"NO_ASYNC_LOADING",
"ADMIN",
"STALE"
],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
]
}
}
3 changes: 0 additions & 3 deletions src/commands/cluster-set-config-epoch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
"ADMIN",
"STALE"
],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
],
"arguments": [
{
"name": "config-epoch",
Expand Down
3 changes: 0 additions & 3 deletions src/commands/cluster-setslot.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
"ADMIN",
"STALE"
],
"command_tips": [
"NONDETERMINISTIC_OUTPUT"
],
"arguments": [
{
"name": "slot",
Expand Down

0 comments on commit 04bdb16

Please sign in to comment.