From 8837c4bafccc1a88cf9875183933acfedbbfea8f Mon Sep 17 00:00:00 2001 From: Huang Zhw Date: Sun, 28 Aug 2022 16:24:47 +0800 Subject: [PATCH] Remove the NONDETERMINISTIC_OUTPUT flag from most CLUSTER sub-commands. (#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. --- src/commands.c | 80 +++++----------------- src/commands/cluster-addslots.json | 3 - src/commands/cluster-addslotsrange.json | 3 - src/commands/cluster-countkeysinslot.json | 3 - src/commands/cluster-delslots.json | 3 - src/commands/cluster-delslotsrange.json | 3 - src/commands/cluster-failover.json | 3 - src/commands/cluster-flushslots.json | 3 - src/commands/cluster-forget.json | 3 - src/commands/cluster-keyslot.json | 3 - src/commands/cluster-meet.json | 3 - src/commands/cluster-myid.json | 3 - src/commands/cluster-replicate.json | 3 - src/commands/cluster-reset.json | 3 - src/commands/cluster-saveconfig.json | 3 - src/commands/cluster-set-config-epoch.json | 3 - src/commands/cluster-setslot.json | 3 - 17 files changed, 16 insertions(+), 112 deletions(-) diff --git a/src/commands.c b/src/commands.c index 9b03c8a37986..4bb753a012c9 100644 --- a/src/commands.c +++ b/src/commands.c @@ -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[] = { @@ -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 range argument table */ struct redisCommandArg CLUSTER_ADDSLOTSRANGE_range_Subargs[] = { @@ -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[] = { @@ -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[] = { @@ -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 range argument table */ struct redisCommandArg CLUSTER_DELSLOTSRANGE_range_Subargs[] = { @@ -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[] = { @@ -380,10 +362,7 @@ 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 ********************/ @@ -391,10 +370,7 @@ NULL #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[] = { @@ -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[] = { @@ -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[] = { @@ -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 ********************/ @@ -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[] = { @@ -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 reset_type argument table */ struct redisCommandArg CLUSTER_RESET_reset_type_Subargs[] = { @@ -575,10 +536,7 @@ 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 ********************/ @@ -586,10 +544,7 @@ NULL #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[] = { @@ -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[] = { diff --git a/src/commands/cluster-addslots.json b/src/commands/cluster-addslots.json index 518d67e09690..0a2d0a82f684 100644 --- a/src/commands/cluster-addslots.json +++ b/src/commands/cluster-addslots.json @@ -12,9 +12,6 @@ "ADMIN", "STALE" ], - "command_tips": [ - "NONDETERMINISTIC_OUTPUT" - ], "arguments": [ { "name": "slot", diff --git a/src/commands/cluster-addslotsrange.json b/src/commands/cluster-addslotsrange.json index 3527f40cb24f..e0bc8f228eeb 100644 --- a/src/commands/cluster-addslotsrange.json +++ b/src/commands/cluster-addslotsrange.json @@ -12,9 +12,6 @@ "ADMIN", "STALE" ], - "command_tips": [ - "NONDETERMINISTIC_OUTPUT" - ], "arguments": [ { "name": "range", diff --git a/src/commands/cluster-countkeysinslot.json b/src/commands/cluster-countkeysinslot.json index 5a9464626556..eefae6e16092 100644 --- a/src/commands/cluster-countkeysinslot.json +++ b/src/commands/cluster-countkeysinslot.json @@ -10,9 +10,6 @@ "command_flags": [ "STALE" ], - "command_tips": [ - "NONDETERMINISTIC_OUTPUT" - ], "arguments": [ { "name": "slot", diff --git a/src/commands/cluster-delslots.json b/src/commands/cluster-delslots.json index 862299b7eecd..89c147b35e85 100644 --- a/src/commands/cluster-delslots.json +++ b/src/commands/cluster-delslots.json @@ -12,9 +12,6 @@ "ADMIN", "STALE" ], - "command_tips": [ - "NONDETERMINISTIC_OUTPUT" - ], "arguments": [ { "name": "slot", diff --git a/src/commands/cluster-delslotsrange.json b/src/commands/cluster-delslotsrange.json index 116d4ff1c546..68a620d69cc7 100644 --- a/src/commands/cluster-delslotsrange.json +++ b/src/commands/cluster-delslotsrange.json @@ -12,9 +12,6 @@ "ADMIN", "STALE" ], - "command_tips": [ - "NONDETERMINISTIC_OUTPUT" - ], "arguments": [ { "name": "range", diff --git a/src/commands/cluster-failover.json b/src/commands/cluster-failover.json index c57a1861bd6b..e7daf241cb95 100644 --- a/src/commands/cluster-failover.json +++ b/src/commands/cluster-failover.json @@ -12,9 +12,6 @@ "ADMIN", "STALE" ], - "command_tips": [ - "NONDETERMINISTIC_OUTPUT" - ], "arguments": [ { "name": "options", diff --git a/src/commands/cluster-flushslots.json b/src/commands/cluster-flushslots.json index 2478713d8c80..214aa396c989 100644 --- a/src/commands/cluster-flushslots.json +++ b/src/commands/cluster-flushslots.json @@ -11,9 +11,6 @@ "NO_ASYNC_LOADING", "ADMIN", "STALE" - ], - "command_tips": [ - "NONDETERMINISTIC_OUTPUT" ] } } diff --git a/src/commands/cluster-forget.json b/src/commands/cluster-forget.json index 8991f76667d9..6668eab21ebb 100644 --- a/src/commands/cluster-forget.json +++ b/src/commands/cluster-forget.json @@ -12,9 +12,6 @@ "ADMIN", "STALE" ], - "command_tips": [ - "NONDETERMINISTIC_OUTPUT" - ], "arguments": [ { "name": "node-id", diff --git a/src/commands/cluster-keyslot.json b/src/commands/cluster-keyslot.json index d078aa3c4a57..10645477fab8 100644 --- a/src/commands/cluster-keyslot.json +++ b/src/commands/cluster-keyslot.json @@ -10,9 +10,6 @@ "command_flags": [ "STALE" ], - "command_tips": [ - "NONDETERMINISTIC_OUTPUT" - ], "arguments": [ { "name": "key", diff --git a/src/commands/cluster-meet.json b/src/commands/cluster-meet.json index c8d55f4e6f98..63d2cc2019ad 100644 --- a/src/commands/cluster-meet.json +++ b/src/commands/cluster-meet.json @@ -18,9 +18,6 @@ "ADMIN", "STALE" ], - "command_tips": [ - "NONDETERMINISTIC_OUTPUT" - ], "arguments": [ { "name": "ip", diff --git a/src/commands/cluster-myid.json b/src/commands/cluster-myid.json index ccb94eb13b1b..dc4f8a773691 100644 --- a/src/commands/cluster-myid.json +++ b/src/commands/cluster-myid.json @@ -9,9 +9,6 @@ "function": "clusterCommand", "command_flags": [ "STALE" - ], - "command_tips": [ - "NONDETERMINISTIC_OUTPUT" ] } } diff --git a/src/commands/cluster-replicate.json b/src/commands/cluster-replicate.json index 87c6cc9aa88b..beda5e7881ee 100644 --- a/src/commands/cluster-replicate.json +++ b/src/commands/cluster-replicate.json @@ -12,9 +12,6 @@ "ADMIN", "STALE" ], - "command_tips": [ - "NONDETERMINISTIC_OUTPUT" - ], "arguments": [ { "name": "node-id", diff --git a/src/commands/cluster-reset.json b/src/commands/cluster-reset.json index b11607a0ee4c..90c810838ee8 100644 --- a/src/commands/cluster-reset.json +++ b/src/commands/cluster-reset.json @@ -12,9 +12,6 @@ "STALE", "NOSCRIPT" ], - "command_tips": [ - "NONDETERMINISTIC_OUTPUT" - ], "arguments": [ { "name": "reset-type", diff --git a/src/commands/cluster-saveconfig.json b/src/commands/cluster-saveconfig.json index 1bf49e7f731d..991286d09c7f 100644 --- a/src/commands/cluster-saveconfig.json +++ b/src/commands/cluster-saveconfig.json @@ -11,9 +11,6 @@ "NO_ASYNC_LOADING", "ADMIN", "STALE" - ], - "command_tips": [ - "NONDETERMINISTIC_OUTPUT" ] } } diff --git a/src/commands/cluster-set-config-epoch.json b/src/commands/cluster-set-config-epoch.json index 2f819052d79f..5f07f63c2a49 100644 --- a/src/commands/cluster-set-config-epoch.json +++ b/src/commands/cluster-set-config-epoch.json @@ -12,9 +12,6 @@ "ADMIN", "STALE" ], - "command_tips": [ - "NONDETERMINISTIC_OUTPUT" - ], "arguments": [ { "name": "config-epoch", diff --git a/src/commands/cluster-setslot.json b/src/commands/cluster-setslot.json index 6bdcae90c3e5..df3b0448c792 100644 --- a/src/commands/cluster-setslot.json +++ b/src/commands/cluster-setslot.json @@ -12,9 +12,6 @@ "ADMIN", "STALE" ], - "command_tips": [ - "NONDETERMINISTIC_OUTPUT" - ], "arguments": [ { "name": "slot",