From 9bce30abe6eb11429cdd3829ea39d3f2608cabba Mon Sep 17 00:00:00 2001 From: hwware Date: Tue, 18 Jun 2024 20:59:00 +0000 Subject: [PATCH] update json file and sentinelCommand function Signed-off-by: hwware --- src/commands.def | 34 +++++++------- src/commands/sentinel-ckquorum.json | 4 +- src/commands/sentinel-failover.json | 4 +- .../sentinel-get-master-addr-by-name.json | 4 +- src/commands/sentinel-info-cache.json | 6 +-- .../sentinel-is-master-down-by-addr.json | 6 +-- src/commands/sentinel-master.json | 6 +-- src/commands/sentinel-masters.json | 6 +-- src/commands/sentinel-remove.json | 2 +- src/commands/sentinel-replicas.json | 4 +- src/commands/sentinel-reset.json | 6 +-- src/commands/sentinel-sentinels.json | 2 +- src/commands/sentinel-set.json | 4 +- src/commands/sentinel-slaves.json | 2 +- src/commands/slaveof.json | 2 +- src/commands/waitaof.json | 2 +- src/sentinel.c | 44 +++++++++---------- 17 files changed, 69 insertions(+), 69 deletions(-) diff --git a/src/commands.def b/src/commands.def index cb7fd73cc5..d017a8f169 100644 --- a/src/commands.def +++ b/src/commands.def @@ -5380,7 +5380,7 @@ struct COMMAND_STRUCT SCRIPT_Subcommands[] = { /* SENTINEL CKQUORUM argument table */ struct COMMAND_ARG SENTINEL_CKQUORUM_Args[] = { -{MAKE_ARG("master-name",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE,0,NULL)}, +{MAKE_ARG("primary-name",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE,0,NULL)}, }; /********** SENTINEL CONFIG ********************/ @@ -5466,7 +5466,7 @@ struct COMMAND_ARG SENTINEL_DEBUG_Args[] = { /* SENTINEL FAILOVER argument table */ struct COMMAND_ARG SENTINEL_FAILOVER_Args[] = { -{MAKE_ARG("master-name",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE,0,NULL)}, +{MAKE_ARG("primary-name",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE,0,NULL)}, }; /********** SENTINEL FLUSHCONFIG ********************/ @@ -5505,7 +5505,7 @@ struct COMMAND_ARG SENTINEL_FAILOVER_Args[] = { /* SENTINEL GET_MASTER_ADDR_BY_NAME argument table */ struct COMMAND_ARG SENTINEL_GET_MASTER_ADDR_BY_NAME_Args[] = { -{MAKE_ARG("master-name",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE,0,NULL)}, +{MAKE_ARG("primary-name",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE,0,NULL)}, }; /********** SENTINEL HELP ********************/ @@ -5591,7 +5591,7 @@ struct COMMAND_ARG SENTINEL_IS_MASTER_DOWN_BY_ADDR_Args[] = { /* SENTINEL MASTER argument table */ struct COMMAND_ARG SENTINEL_MASTER_Args[] = { -{MAKE_ARG("master-name",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE,0,NULL)}, +{MAKE_ARG("primary-name",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE,0,NULL)}, }; /********** SENTINEL MASTERS ********************/ @@ -5689,7 +5689,7 @@ struct COMMAND_ARG SENTINEL_MONITOR_Args[] = { /* SENTINEL REMOVE argument table */ struct COMMAND_ARG SENTINEL_REMOVE_Args[] = { -{MAKE_ARG("master-name",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE,0,NULL)}, +{MAKE_ARG("primary-name",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE,0,NULL)}, }; /********** SENTINEL REPLICAS ********************/ @@ -5711,7 +5711,7 @@ struct COMMAND_ARG SENTINEL_REMOVE_Args[] = { /* SENTINEL REPLICAS argument table */ struct COMMAND_ARG SENTINEL_REPLICAS_Args[] = { -{MAKE_ARG("master-name",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE,0,NULL)}, +{MAKE_ARG("primary-name",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE,0,NULL)}, }; /********** SENTINEL RESET ********************/ @@ -5755,7 +5755,7 @@ struct COMMAND_ARG SENTINEL_RESET_Args[] = { /* SENTINEL SENTINELS argument table */ struct COMMAND_ARG SENTINEL_SENTINELS_Args[] = { -{MAKE_ARG("master-name",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE,0,NULL)}, +{MAKE_ARG("primary-name",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE,0,NULL)}, }; /********** SENTINEL SET ********************/ @@ -5783,7 +5783,7 @@ struct COMMAND_ARG SENTINEL_SET_data_Subargs[] = { /* SENTINEL SET argument table */ struct COMMAND_ARG SENTINEL_SET_Args[] = { -{MAKE_ARG("master-name",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE,0,NULL)}, +{MAKE_ARG("primary-name",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE,0,NULL)}, {MAKE_ARG("data",ARG_TYPE_BLOCK,-1,NULL,NULL,NULL,CMD_ARG_MULTIPLE,2,NULL),.subargs=SENTINEL_SET_data_Subargs}, }; @@ -5835,7 +5835,7 @@ struct COMMAND_ARG SENTINEL_SIMULATE_FAILURE_Args[] = { /* SENTINEL SLAVES argument table */ struct COMMAND_ARG SENTINEL_SLAVES_Args[] = { -{MAKE_ARG("master-name",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE,0,NULL)}, +{MAKE_ARG("primary-name",ARG_TYPE_STRING,-1,NULL,NULL,NULL,CMD_ARG_NONE,0,NULL)}, }; /* SENTINEL command table */ @@ -5845,20 +5845,20 @@ struct COMMAND_STRUCT SENTINEL_Subcommands[] = { {MAKE_CMD("debug","Lists or updates the current configurable parameters of Sentinel.","O(N) where N is the number of configurable parameters","7.0.0",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_DEBUG_History,0,SENTINEL_DEBUG_Tips,0,sentinelCommand,-2,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_DEBUG_Keyspecs,0,NULL,1),.args=SENTINEL_DEBUG_Args}, {MAKE_CMD("failover","Forces a Sentinel failover.",NULL,"2.8.4",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_FAILOVER_History,0,SENTINEL_FAILOVER_Tips,0,sentinelCommand,3,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_FAILOVER_Keyspecs,0,NULL,1),.args=SENTINEL_FAILOVER_Args}, {MAKE_CMD("flushconfig","Rewrites the Sentinel configuration file.","O(1)","2.8.4",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_FLUSHCONFIG_History,0,SENTINEL_FLUSHCONFIG_Tips,0,sentinelCommand,2,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_FLUSHCONFIG_Keyspecs,0,NULL,0)}, -{MAKE_CMD("get-master-addr-by-name","Returns the port and address of a master instance.","O(1)","2.8.4",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_GET_MASTER_ADDR_BY_NAME_History,0,SENTINEL_GET_MASTER_ADDR_BY_NAME_Tips,0,sentinelCommand,3,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_GET_MASTER_ADDR_BY_NAME_Keyspecs,0,NULL,1),.args=SENTINEL_GET_MASTER_ADDR_BY_NAME_Args}, +{MAKE_CMD("get-master-addr-by-name","Returns the port and address of a primary instance.","O(1)","2.8.4",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_GET_MASTER_ADDR_BY_NAME_History,0,SENTINEL_GET_MASTER_ADDR_BY_NAME_Tips,0,sentinelCommand,3,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_GET_MASTER_ADDR_BY_NAME_Keyspecs,0,NULL,1),.args=SENTINEL_GET_MASTER_ADDR_BY_NAME_Args}, {MAKE_CMD("help","Returns helpful text about the different subcommands.","O(1)","6.2.0",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_HELP_History,0,SENTINEL_HELP_Tips,0,sentinelCommand,2,CMD_LOADING|CMD_STALE|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_HELP_Keyspecs,0,NULL,0)}, {MAKE_CMD("info-cache","Returns the cached `INFO` replies from the deployment's instances.","O(N) where N is the number of instances","3.2.0",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_INFO_CACHE_History,0,SENTINEL_INFO_CACHE_Tips,0,sentinelCommand,-3,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_INFO_CACHE_Keyspecs,0,NULL,1),.args=SENTINEL_INFO_CACHE_Args}, -{MAKE_CMD("is-master-down-by-addr","Determines whether a master instance is down.","O(1)","2.8.4",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_IS_MASTER_DOWN_BY_ADDR_History,0,SENTINEL_IS_MASTER_DOWN_BY_ADDR_Tips,0,sentinelCommand,6,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_IS_MASTER_DOWN_BY_ADDR_Keyspecs,0,NULL,4),.args=SENTINEL_IS_MASTER_DOWN_BY_ADDR_Args}, -{MAKE_CMD("master","Returns the state of a master instance.","O(1)","2.8.4",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_MASTER_History,0,SENTINEL_MASTER_Tips,0,sentinelCommand,3,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_MASTER_Keyspecs,0,NULL,1),.args=SENTINEL_MASTER_Args}, -{MAKE_CMD("masters","Returns a list of monitored masters.","O(N) where N is the number of masters","2.8.4",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_MASTERS_History,0,SENTINEL_MASTERS_Tips,0,sentinelCommand,2,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_MASTERS_Keyspecs,0,NULL,0)}, +{MAKE_CMD("is-master-down-by-addr","Determines whether a primary instance is down.","O(1)","2.8.4",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_IS_MASTER_DOWN_BY_ADDR_History,0,SENTINEL_IS_MASTER_DOWN_BY_ADDR_Tips,0,sentinelCommand,6,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_IS_MASTER_DOWN_BY_ADDR_Keyspecs,0,NULL,4),.args=SENTINEL_IS_MASTER_DOWN_BY_ADDR_Args}, +{MAKE_CMD("master","Returns the state of a primary instance.","O(1)","2.8.4",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_MASTER_History,0,SENTINEL_MASTER_Tips,0,sentinelCommand,3,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_MASTER_Keyspecs,0,NULL,1),.args=SENTINEL_MASTER_Args}, +{MAKE_CMD("masters","Returns a list of monitored primaries.","O(N) where N is the number of primaries","2.8.4",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_MASTERS_History,0,SENTINEL_MASTERS_Tips,0,sentinelCommand,2,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_MASTERS_Keyspecs,0,NULL,0)}, {MAKE_CMD("monitor","Starts monitoring.","O(1)","2.8.4",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_MONITOR_History,0,SENTINEL_MONITOR_Tips,0,sentinelCommand,6,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_MONITOR_Keyspecs,0,NULL,4),.args=SENTINEL_MONITOR_Args}, {MAKE_CMD("myid","Returns the Sentinel instance ID.","O(1)","6.2.0",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_MYID_History,0,SENTINEL_MYID_Tips,0,sentinelCommand,2,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_MYID_Keyspecs,0,NULL,0)}, {MAKE_CMD("pending-scripts","Returns information about pending scripts for Sentinel.",NULL,"2.8.4",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_PENDING_SCRIPTS_History,0,SENTINEL_PENDING_SCRIPTS_Tips,0,sentinelCommand,2,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_PENDING_SCRIPTS_Keyspecs,0,NULL,0)}, {MAKE_CMD("remove","Stops monitoring.","O(1)","2.8.4",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_REMOVE_History,0,SENTINEL_REMOVE_Tips,0,sentinelCommand,3,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_REMOVE_Keyspecs,0,NULL,1),.args=SENTINEL_REMOVE_Args}, {MAKE_CMD("replicas","Returns a list of the monitored replicas.","O(N) where N is the number of replicas","5.0.0",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_REPLICAS_History,0,SENTINEL_REPLICAS_Tips,0,sentinelCommand,3,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_REPLICAS_Keyspecs,0,NULL,1),.args=SENTINEL_REPLICAS_Args}, -{MAKE_CMD("reset","Resets masters by name matching a pattern.","O(N) where N is the number of monitored masters","2.8.4",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_RESET_History,0,SENTINEL_RESET_Tips,0,sentinelCommand,3,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_RESET_Keyspecs,0,NULL,1),.args=SENTINEL_RESET_Args}, +{MAKE_CMD("reset","Resets primaries by name matching a pattern.","O(N) where N is the number of monitored primaries","2.8.4",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_RESET_History,0,SENTINEL_RESET_Tips,0,sentinelCommand,3,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_RESET_Keyspecs,0,NULL,1),.args=SENTINEL_RESET_Args}, {MAKE_CMD("sentinels","Returns a list of Sentinel instances.","O(N) where N is the number of Sentinels","2.8.4",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_SENTINELS_History,0,SENTINEL_SENTINELS_Tips,0,sentinelCommand,3,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_SENTINELS_Keyspecs,0,NULL,1),.args=SENTINEL_SENTINELS_Args}, -{MAKE_CMD("set","Changes the configuration of a monitored master.","O(1)","2.8.4",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_SET_History,0,SENTINEL_SET_Tips,0,sentinelCommand,-5,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_SET_Keyspecs,0,NULL,2),.args=SENTINEL_SET_Args}, +{MAKE_CMD("set","Changes the configuration of a monitored primary.","O(1)","2.8.4",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_SET_History,0,SENTINEL_SET_Tips,0,sentinelCommand,-5,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_SET_Keyspecs,0,NULL,2),.args=SENTINEL_SET_Args}, {MAKE_CMD("simulate-failure","Simulates failover scenarios.",NULL,"3.2.0",CMD_DOC_NONE,NULL,NULL,"sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_SIMULATE_FAILURE_History,0,SENTINEL_SIMULATE_FAILURE_Tips,0,sentinelCommand,-3,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_SIMULATE_FAILURE_Keyspecs,0,NULL,1),.args=SENTINEL_SIMULATE_FAILURE_Args}, {MAKE_CMD("slaves","Returns a list of the monitored replicas.","O(N) where N is the number of replicas.","2.8.0",CMD_DOC_DEPRECATED,"`SENTINEL REPLICAS`","5.0.0","sentinel",COMMAND_GROUP_SENTINEL,SENTINEL_SLAVES_History,0,SENTINEL_SLAVES_Tips,0,sentinelCommand,3,CMD_ADMIN|CMD_SENTINEL|CMD_ONLY_SENTINEL,0,SENTINEL_SLAVES_Keyspecs,0,NULL,1),.args=SENTINEL_SLAVES_Args}, {0} @@ -10720,7 +10720,7 @@ struct COMMAND_STRUCT serverCommandTable[] = { {MAKE_CMD("type","Determines the type of value stored at a key.","O(1)","1.0.0",CMD_DOC_NONE,NULL,NULL,"generic",COMMAND_GROUP_GENERIC,TYPE_History,0,TYPE_Tips,0,typeCommand,2,CMD_READONLY|CMD_FAST,ACL_CATEGORY_KEYSPACE,TYPE_Keyspecs,1,NULL,1),.args=TYPE_Args}, {MAKE_CMD("unlink","Asynchronously deletes one or more keys.","O(1) for each key removed regardless of its size. Then the command does O(N) work in a different thread in order to reclaim memory, where N is the number of allocations the deleted objects where composed of.","4.0.0",CMD_DOC_NONE,NULL,NULL,"generic",COMMAND_GROUP_GENERIC,UNLINK_History,0,UNLINK_Tips,2,unlinkCommand,-2,CMD_WRITE|CMD_FAST,ACL_CATEGORY_KEYSPACE,UNLINK_Keyspecs,1,NULL,1),.args=UNLINK_Args}, {MAKE_CMD("wait","Blocks until the asynchronous replication of all preceding write commands sent by the connection is completed.","O(1)","3.0.0",CMD_DOC_NONE,NULL,NULL,"generic",COMMAND_GROUP_GENERIC,WAIT_History,0,WAIT_Tips,2,waitCommand,3,CMD_BLOCKING,ACL_CATEGORY_CONNECTION,WAIT_Keyspecs,0,NULL,2),.args=WAIT_Args}, -{MAKE_CMD("waitaof","Blocks until all of the preceding write commands sent by the connection are written to the append-only file of the master and/or replicas.","O(1)","7.2.0",CMD_DOC_NONE,NULL,NULL,"generic",COMMAND_GROUP_GENERIC,WAITAOF_History,0,WAITAOF_Tips,2,waitaofCommand,4,CMD_BLOCKING,ACL_CATEGORY_CONNECTION,WAITAOF_Keyspecs,0,NULL,3),.args=WAITAOF_Args}, +{MAKE_CMD("waitaof","Blocks until all of the preceding write commands sent by the connection are written to the append-only file of the primary and/or replicas.","O(1)","7.2.0",CMD_DOC_NONE,NULL,NULL,"generic",COMMAND_GROUP_GENERIC,WAITAOF_History,0,WAITAOF_Tips,2,waitaofCommand,4,CMD_BLOCKING,ACL_CATEGORY_CONNECTION,WAITAOF_Keyspecs,0,NULL,3),.args=WAITAOF_Args}, /* geo */ {MAKE_CMD("geoadd","Adds one or more members to a geospatial index. The key is created if it doesn't exist.","O(log(N)) for each item added, where N is the number of elements in the sorted set.","3.2.0",CMD_DOC_NONE,NULL,NULL,"geo",COMMAND_GROUP_GEO,GEOADD_History,1,GEOADD_Tips,0,geoaddCommand,-5,CMD_WRITE|CMD_DENYOOM,ACL_CATEGORY_GEO,GEOADD_Keyspecs,1,NULL,4),.args=GEOADD_Args}, {MAKE_CMD("geodist","Returns the distance between two members of a geospatial index.","O(1)","3.2.0",CMD_DOC_NONE,NULL,NULL,"geo",COMMAND_GROUP_GEO,GEODIST_History,0,GEODIST_Tips,0,geodistCommand,-4,CMD_READONLY,ACL_CATEGORY_GEO,GEODIST_Keyspecs,1,NULL,4),.args=GEODIST_Args}, @@ -10824,7 +10824,7 @@ struct COMMAND_STRUCT serverCommandTable[] = { {MAKE_CMD("role","Returns the replication role.","O(1)","2.8.12",CMD_DOC_NONE,NULL,NULL,"server",COMMAND_GROUP_SERVER,ROLE_History,0,ROLE_Tips,0,roleCommand,1,CMD_NOSCRIPT|CMD_LOADING|CMD_STALE|CMD_FAST|CMD_SENTINEL,ACL_CATEGORY_ADMIN|ACL_CATEGORY_DANGEROUS,ROLE_Keyspecs,0,NULL,0)}, {MAKE_CMD("save","Synchronously saves the database(s) to disk.","O(N) where N is the total number of keys in all databases","1.0.0",CMD_DOC_NONE,NULL,NULL,"server",COMMAND_GROUP_SERVER,SAVE_History,0,SAVE_Tips,0,saveCommand,1,CMD_NO_ASYNC_LOADING|CMD_ADMIN|CMD_NOSCRIPT|CMD_NO_MULTI,0,SAVE_Keyspecs,0,NULL,0)}, {MAKE_CMD("shutdown","Synchronously saves the database(s) to disk and shuts down the server.","O(N) when saving, where N is the total number of keys in all databases when saving data, otherwise O(1)","1.0.0",CMD_DOC_NONE,NULL,NULL,"server",COMMAND_GROUP_SERVER,SHUTDOWN_History,1,SHUTDOWN_Tips,0,shutdownCommand,-1,CMD_ADMIN|CMD_NOSCRIPT|CMD_LOADING|CMD_STALE|CMD_NO_MULTI|CMD_SENTINEL|CMD_ALLOW_BUSY,0,SHUTDOWN_Keyspecs,0,NULL,1),.args=SHUTDOWN_Args}, -{MAKE_CMD("slaveof","Sets a server as a replica of another, or promotes it to being a master.","O(1)","1.0.0",CMD_DOC_DEPRECATED,"`REPLICAOF`","5.0.0","server",COMMAND_GROUP_SERVER,SLAVEOF_History,0,SLAVEOF_Tips,0,replicaofCommand,3,CMD_NO_ASYNC_LOADING|CMD_ADMIN|CMD_NOSCRIPT|CMD_STALE,0,SLAVEOF_Keyspecs,0,NULL,1),.args=SLAVEOF_Args}, +{MAKE_CMD("slaveof","Sets a server as a replica of another, or promotes it to being a primary.","O(1)","1.0.0",CMD_DOC_DEPRECATED,"`REPLICAOF`","5.0.0","server",COMMAND_GROUP_SERVER,SLAVEOF_History,0,SLAVEOF_Tips,0,replicaofCommand,3,CMD_NO_ASYNC_LOADING|CMD_ADMIN|CMD_NOSCRIPT|CMD_STALE,0,SLAVEOF_Keyspecs,0,NULL,1),.args=SLAVEOF_Args}, {MAKE_CMD("slowlog","A container for slow log commands.","Depends on subcommand.","2.2.12",CMD_DOC_NONE,NULL,NULL,"server",COMMAND_GROUP_SERVER,SLOWLOG_History,0,SLOWLOG_Tips,0,NULL,-2,0,0,SLOWLOG_Keyspecs,0,NULL,0),.subcommands=SLOWLOG_Subcommands}, {MAKE_CMD("swapdb","Swaps two databases.","O(N) where N is the count of clients watching or blocking on keys from both databases.","4.0.0",CMD_DOC_NONE,NULL,NULL,"server",COMMAND_GROUP_SERVER,SWAPDB_History,0,SWAPDB_Tips,0,swapdbCommand,3,CMD_WRITE|CMD_FAST,ACL_CATEGORY_KEYSPACE|ACL_CATEGORY_DANGEROUS,SWAPDB_Keyspecs,0,NULL,2),.args=SWAPDB_Args}, {MAKE_CMD("sync","An internal command used in replication.",NULL,"1.0.0",CMD_DOC_NONE,NULL,NULL,"server",COMMAND_GROUP_SERVER,SYNC_History,0,SYNC_Tips,0,syncCommand,1,CMD_NO_ASYNC_LOADING|CMD_ADMIN|CMD_NO_MULTI|CMD_NOSCRIPT,0,SYNC_Keyspecs,0,NULL,0)}, diff --git a/src/commands/sentinel-ckquorum.json b/src/commands/sentinel-ckquorum.json index e79132303f..7f4428c3fe 100644 --- a/src/commands/sentinel-ckquorum.json +++ b/src/commands/sentinel-ckquorum.json @@ -13,12 +13,12 @@ ], "reply_schema": { "type": "string", - "description": "Returns OK if the current Sentinel configuration is able to reach the quorum needed to failover a master, and the majority needed to authorize the failover.", + "description": "Returns OK if the current Sentinel configuration is able to reach the quorum needed to failover a primary, and the majority needed to authorize the failover.", "pattern": "OK" }, "arguments": [ { - "name": "master-name", + "name": "primary-name", "type": "string" } ] diff --git a/src/commands/sentinel-failover.json b/src/commands/sentinel-failover.json index 8a211990f2..8e7c3ea3e7 100644 --- a/src/commands/sentinel-failover.json +++ b/src/commands/sentinel-failover.json @@ -13,11 +13,11 @@ ], "reply_schema": { "const": "OK", - "description": "Force a fail over as if the master was not reachable, and without asking for agreement to other Sentinels." + "description": "Force a fail over as if the primary was not reachable, and without asking for agreement to other Sentinels." }, "arguments": [ { - "name": "master-name", + "name": "primary-name", "type": "string" } ] diff --git a/src/commands/sentinel-get-master-addr-by-name.json b/src/commands/sentinel-get-master-addr-by-name.json index 1bcbec5341..2d7fc50eda 100644 --- a/src/commands/sentinel-get-master-addr-by-name.json +++ b/src/commands/sentinel-get-master-addr-by-name.json @@ -1,6 +1,6 @@ { "GET-MASTER-ADDR-BY-NAME": { - "summary": "Returns the port and address of a master instance.", + "summary": "Returns the port and address of a primary instance.", "complexity": "O(1)", "group": "sentinel", "since": "2.8.4", @@ -30,7 +30,7 @@ }, "arguments": [ { - "name": "master-name", + "name": "primary-name", "type": "string" } ] diff --git a/src/commands/sentinel-info-cache.json b/src/commands/sentinel-info-cache.json index af89f182ea..44edcf35e3 100644 --- a/src/commands/sentinel-info-cache.json +++ b/src/commands/sentinel-info-cache.json @@ -14,7 +14,7 @@ ], "reply_schema": { "type": "array", - "description": "This is actually a map, the odd entries are a master name, and the even entries are the last cached INFO output from that master and all its replicas.", + "description": "This is actually a map, the odd entries are a primary name, and the even entries are the last cached INFO output from that primary and all its replicas.", "minItems": 0, "maxItems": 4294967295, "items": [ @@ -22,11 +22,11 @@ "oneOf": [ { "type": "string", - "description": "The master name." + "description": "The primary name." }, { "type": "array", - "description": "This is an array of pairs, the odd entries are the INFO age, and the even entries are the cached INFO string. The first pair belong to the master and the rest are its replicas.", + "description": "This is an array of pairs, the odd entries are the INFO age, and the even entries are the cached INFO string. The first pair belong to the primary and the rest are its replicas.", "minItems": 2, "maxItems": 2, "items": [ diff --git a/src/commands/sentinel-is-master-down-by-addr.json b/src/commands/sentinel-is-master-down-by-addr.json index fd7698014c..3ecf8723fb 100644 --- a/src/commands/sentinel-is-master-down-by-addr.json +++ b/src/commands/sentinel-is-master-down-by-addr.json @@ -1,6 +1,6 @@ { "IS-MASTER-DOWN-BY-ADDR": { - "summary": "Determines whether a master instance is down.", + "summary": "Determines whether a primary instance is down.", "complexity": "O(1)", "group": "sentinel", "since": "2.8.4", @@ -21,11 +21,11 @@ "oneOf": [ { "const": 0, - "description": "Master is up." + "description": "Primary is up." }, { "const": 1, - "description": "Master is down." + "description": "Primary is down." } ] }, diff --git a/src/commands/sentinel-master.json b/src/commands/sentinel-master.json index ff94617aeb..3af3227394 100644 --- a/src/commands/sentinel-master.json +++ b/src/commands/sentinel-master.json @@ -1,6 +1,6 @@ { "MASTER": { - "summary": "Returns the state of a master instance.", + "summary": "Returns the state of a primary instance.", "complexity": "O(1)", "group": "sentinel", "since": "2.8.4", @@ -14,14 +14,14 @@ ], "reply_schema": { "type": "object", - "description": "The state and info of the specified master.", + "description": "The state and info of the specified primary.", "additionalProperties": { "type": "string" } }, "arguments": [ { - "name": "master-name", + "name": "primary-name", "type": "string" } ] diff --git a/src/commands/sentinel-masters.json b/src/commands/sentinel-masters.json index 26992585a1..b6aa86d02a 100644 --- a/src/commands/sentinel-masters.json +++ b/src/commands/sentinel-masters.json @@ -1,7 +1,7 @@ { "MASTERS": { - "summary": "Returns a list of monitored masters.", - "complexity": "O(N) where N is the number of masters", + "summary": "Returns a list of monitored primaries.", + "complexity": "O(N) where N is the number of primaries", "group": "sentinel", "since": "2.8.4", "arity": 2, @@ -14,7 +14,7 @@ ], "reply_schema": { "type": "array", - "description": "List of monitored masters, and their state.", + "description": "List of monitored primaries, and their state.", "items": { "type": "object", "additionalProperties": { diff --git a/src/commands/sentinel-remove.json b/src/commands/sentinel-remove.json index 1fe084f42c..7d545c3715 100644 --- a/src/commands/sentinel-remove.json +++ b/src/commands/sentinel-remove.json @@ -17,7 +17,7 @@ }, "arguments": [ { - "name": "master-name", + "name": "primary-name", "type": "string" } ] diff --git a/src/commands/sentinel-replicas.json b/src/commands/sentinel-replicas.json index 32b04e994a..a81ed0ef00 100644 --- a/src/commands/sentinel-replicas.json +++ b/src/commands/sentinel-replicas.json @@ -14,7 +14,7 @@ ], "reply_schema": { "type": "array", - "description": "List of replicas for this master, and their state.", + "description": "List of replicas for this primary, and their state.", "items": { "type": "object", "additionalProperties": { @@ -24,7 +24,7 @@ }, "arguments": [ { - "name": "master-name", + "name": "primary-name", "type": "string" } ] diff --git a/src/commands/sentinel-reset.json b/src/commands/sentinel-reset.json index 5d2a63f3d5..35153609cb 100644 --- a/src/commands/sentinel-reset.json +++ b/src/commands/sentinel-reset.json @@ -1,7 +1,7 @@ { "RESET": { - "summary": "Resets masters by name matching a pattern.", - "complexity": "O(N) where N is the number of monitored masters", + "summary": "Resets primaries by name matching a pattern.", + "complexity": "O(N) where N is the number of monitored primaries", "group": "sentinel", "since": "2.8.4", "arity": 3, @@ -14,7 +14,7 @@ ], "reply_schema": { "type": "integer", - "description": "The number of masters that were reset." + "description": "The number of primaries that were reset." }, "arguments": [ { diff --git a/src/commands/sentinel-sentinels.json b/src/commands/sentinel-sentinels.json index fdaa5cb992..dae12c5a9b 100644 --- a/src/commands/sentinel-sentinels.json +++ b/src/commands/sentinel-sentinels.json @@ -24,7 +24,7 @@ }, "arguments": [ { - "name": "master-name", + "name": "primary-name", "type": "string" } ] diff --git a/src/commands/sentinel-set.json b/src/commands/sentinel-set.json index abca33b89a..43523e6d6b 100644 --- a/src/commands/sentinel-set.json +++ b/src/commands/sentinel-set.json @@ -1,6 +1,6 @@ { "SET": { - "summary": "Changes the configuration of a monitored master.", + "summary": "Changes the configuration of a monitored primary.", "complexity": "O(1)", "group": "sentinel", "since": "2.8.4", @@ -17,7 +17,7 @@ }, "arguments": [ { - "name": "master-name", + "name": "primary-name", "type": "string" }, { diff --git a/src/commands/sentinel-slaves.json b/src/commands/sentinel-slaves.json index c1fec41bb2..9792270982 100644 --- a/src/commands/sentinel-slaves.json +++ b/src/commands/sentinel-slaves.json @@ -29,7 +29,7 @@ }, "arguments": [ { - "name": "master-name", + "name": "primary-name", "type": "string" } ] diff --git a/src/commands/slaveof.json b/src/commands/slaveof.json index ca30982887..509bdfbee3 100644 --- a/src/commands/slaveof.json +++ b/src/commands/slaveof.json @@ -1,6 +1,6 @@ { "SLAVEOF": { - "summary": "Sets a server as a replica of another, or promotes it to being a master.", + "summary": "Sets a server as a replica of another, or promotes it to being a primary.", "complexity": "O(1)", "group": "server", "since": "1.0.0", diff --git a/src/commands/waitaof.json b/src/commands/waitaof.json index 19b514c274..d664000b5f 100644 --- a/src/commands/waitaof.json +++ b/src/commands/waitaof.json @@ -1,6 +1,6 @@ { "WAITAOF": { - "summary": "Blocks until all of the preceding write commands sent by the connection are written to the append-only file of the master and/or replicas.", + "summary": "Blocks until all of the preceding write commands sent by the connection are written to the append-only file of the primary and/or replicas.", "complexity": "O(1)", "group": "generic", "since": "7.2.0", diff --git a/src/sentinel.c b/src/sentinel.c index 49adcc05c9..8c851a9344 100644 --- a/src/sentinel.c +++ b/src/sentinel.c @@ -3675,9 +3675,9 @@ void sentinelCommand(client *c) { if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr, "help")) { /* clang-format off */ const char *help[] = { -"CKQUORUM ", +"CKQUORUM ", " Check if the current Sentinel configuration is able to reach the quorum", -" needed to failover a master and the majority needed to authorize the", +" needed to failover a primary and the majority needed to authorize the", " failover.", "CONFIG SET param value [param value ...]", " Set a global Sentinel configuration parameter.", @@ -3686,39 +3686,39 @@ void sentinelCommand(client *c) { "DEBUG [ ...]", " Show a list of configurable time parameters and their values (milliseconds).", " Or update current configurable parameters values (one or more).", -"GET-MASTER-ADDR-BY-NAME ", -" Return the ip and port number of the master with that name.", -"FAILOVER ", -" Manually failover a master node without asking for agreement from other", +"GET-MASTER-ADDR-BY-NAME ", +" Return the ip and port number of the primary with that name.", +"FAILOVER ", +" Manually failover a primary node without asking for agreement from other", " Sentinels", "FLUSHCONFIG", " Force Sentinel to rewrite its configuration on disk, including the current", " Sentinel state.", -"INFO-CACHE ", -" Return last cached INFO output from masters and all its replicas.", +"INFO-CACHE ", +" Return last cached INFO output from primaries and all its replicas.", "IS-MASTER-DOWN-BY-ADDR ", -" Check if the master specified by ip:port is down from current Sentinel's", +" Check if the primary specified by ip:port is down from current Sentinel's", " point of view.", -"MASTER ", -" Show the state and info of the specified master.", +"MASTER ", +" Show the state and info of the specified primary.", "MASTERS", -" Show a list of monitored masters and their state.", +" Show a list of monitored primaries and their state.", "MONITOR ", -" Start monitoring a new master with the specified name, ip, port and quorum.", +" Start monitoring a new primary with the specified name, ip, port and quorum.", "MYID", " Return the ID of the Sentinel instance.", "PENDING-SCRIPTS", " Get pending scripts information.", -"REMOVE ", -" Remove master from Sentinel's monitor list.", -"REPLICAS ", -" Show a list of replicas for this master and their state.", +"REMOVE ", +" Remove primary from Sentinel's monitor list.", +"REPLICAS ", +" Show a list of replicas for this primary and their states.", "RESET ", -" Reset masters for specific master name matching this pattern.", -"SENTINELS ", -" Show a list of Sentinel instances for this master and their state.", -"SET