Skip to content

Commit

Permalink
update json file and sentinelCommand function
Browse files Browse the repository at this point in the history
Signed-off-by: hwware <[email protected]>
  • Loading branch information
hwware committed Jun 19, 2024
1 parent be2c321 commit 9bce30a
Show file tree
Hide file tree
Showing 17 changed files with 69 additions and 69 deletions.
34 changes: 17 additions & 17 deletions src/commands.def

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/commands/sentinel-ckquorum.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
Expand Down
4 changes: 2 additions & 2 deletions src/commands/sentinel-failover.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
Expand Down
4 changes: 2 additions & 2 deletions src/commands/sentinel-get-master-addr-by-name.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -30,7 +30,7 @@
},
"arguments": [
{
"name": "master-name",
"name": "primary-name",
"type": "string"
}
]
Expand Down
6 changes: 3 additions & 3 deletions src/commands/sentinel-info-cache.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
],
"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": [
{
"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": [
Expand Down
6 changes: 3 additions & 3 deletions src/commands/sentinel-is-master-down-by-addr.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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."
}
]
},
Expand Down
6 changes: 3 additions & 3 deletions src/commands/sentinel-master.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
}
]
Expand Down
6 changes: 3 additions & 3 deletions src/commands/sentinel-masters.json
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/sentinel-remove.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"arguments": [
{
"name": "master-name",
"name": "primary-name",
"type": "string"
}
]
Expand Down
4 changes: 2 additions & 2 deletions src/commands/sentinel-replicas.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -24,7 +24,7 @@
},
"arguments": [
{
"name": "master-name",
"name": "primary-name",
"type": "string"
}
]
Expand Down
6 changes: 3 additions & 3 deletions src/commands/sentinel-reset.json
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/commands/sentinel-sentinels.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"arguments": [
{
"name": "master-name",
"name": "primary-name",
"type": "string"
}
]
Expand Down
4 changes: 2 additions & 2 deletions src/commands/sentinel-set.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -17,7 +17,7 @@
},
"arguments": [
{
"name": "master-name",
"name": "primary-name",
"type": "string"
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/commands/sentinel-slaves.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"arguments": [
{
"name": "master-name",
"name": "primary-name",
"type": "string"
}
]
Expand Down
2 changes: 1 addition & 1 deletion src/commands/slaveof.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/waitaof.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
44 changes: 22 additions & 22 deletions src/sentinel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <master-name>",
"CKQUORUM <primary-name>",
" 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.",
Expand All @@ -3686,39 +3686,39 @@ void sentinelCommand(client *c) {
"DEBUG [<param> <value> ...]",
" 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 <master-name>",
" Return the ip and port number of the master with that name.",
"FAILOVER <master-name>",
" Manually failover a master node without asking for agreement from other",
"GET-MASTER-ADDR-BY-NAME <primary-name>",
" Return the ip and port number of the primary with that name.",
"FAILOVER <primary-name>",
" 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 <master-name>",
" Return last cached INFO output from masters and all its replicas.",
"INFO-CACHE <primary-name>",
" Return last cached INFO output from primaries and all its replicas.",
"IS-MASTER-DOWN-BY-ADDR <ip> <port> <current-epoch> <runid>",
" 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 <master-name>",
" Show the state and info of the specified master.",
"MASTER <primary-name>",
" 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 <name> <ip> <port> <quorum>",
" 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 <master-name>",
" Remove master from Sentinel's monitor list.",
"REPLICAS <master-name>",
" Show a list of replicas for this master and their state.",
"REMOVE <primary-name>",
" Remove primary from Sentinel's monitor list.",
"REPLICAS <primary-name>",
" Show a list of replicas for this primary and their states.",
"RESET <pattern>",
" Reset masters for specific master name matching this pattern.",
"SENTINELS <master-name>",
" Show a list of Sentinel instances for this master and their state.",
"SET <master-name> <option> <value> [<option> <value> ...]",
" Set configuration parameters for certain masters.",
" Reset primaries for specific primary name matching this pattern.",
"SENTINELS <primary-name>",
" Show a list of Sentinel instances for this primary and their state.",
"SET <primary-name> <option> <value> [<option> <value> ...]",
" Set configuration parameters for certain primaries.",
"SIMULATE-FAILURE [CRASH-AFTER-ELECTION] [CRASH-AFTER-PROMOTION] [HELP]",
" Simulate a Sentinel crash.",
NULL
Expand Down

0 comments on commit 9bce30a

Please sign in to comment.