forked from valkey-io/valkey
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 4 commands for sentinel and update most test cases and json files (…
…valkey-io#789) Add 4 new commands for Sentinel (reference valkey-io#36) Sentinel GET-PRIMARY-ADDR-BY-NAME Sentinel PRIMARY Sentinel PRIMARIES Sentinel IS-PRIMARY-DOWN-BY-ADDR and deprecate 4 old commands: Sentinel GET-MASTER-ADDR-BY-NAME Sentinel MASTER Sentinel MASTERS Sentinel IS-MASTER-DOWN-BY-ADDR and all sentinel tests pass here https://github.com/hwware/valkey/actions/runs/9962102363/job/27525124583 Note: 1. runtest-sentinel pass all test cases 2. I finished a sentinel rolling upgrade test: 1 primary 2 replicas 3 sentinel there are 4 steps in this test scenario: step 1: all 3 sentinel nodes run old sentinel, shutdown primary, and then new primary can be voted successfully. step 2: replace sentinel 1 with new sentinel bin file, and then shutdown primary, and then another new primary can be voted successfully step 3: replace sentinel 2 with new sentinel bin file, and then shutdown primary, and then another new primary can be voted successfully step 4: replace sentinel 3 with new sentinel bin file, and then shutdown primary, and then another new primary can be voted successfully We can see, even mixed version sentinel running, whole system still works. --------- Signed-off-by: hwware <wen.hui.ware@gmail.com> Signed-off-by: mwish <maplewish117@gmail.com>
- Loading branch information
Showing
23 changed files
with
362 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"GET-PRIMARY-ADDR-BY-NAME": { | ||
"summary": "Returns the port and address of a primary instance.", | ||
"complexity": "O(1)", | ||
"group": "sentinel", | ||
"since": "8.0.0", | ||
"arity": 3, | ||
"container": "SENTINEL", | ||
"function": "sentinelCommand", | ||
"command_flags": [ | ||
"ADMIN", | ||
"SENTINEL", | ||
"ONLY_SENTINEL" | ||
], | ||
"reply_schema": { | ||
"type": "array", | ||
"minItems": 2, | ||
"maxItems": 2, | ||
"items": [ | ||
{ | ||
"type": "string", | ||
"description": "IP addr or hostname." | ||
}, | ||
{ | ||
"type": "string", | ||
"description": "Port.", | ||
"pattern": "[0-9]+" | ||
} | ||
] | ||
}, | ||
"arguments": [ | ||
{ | ||
"name": "primary-name", | ||
"type": "string" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"IS-PRIMARY-DOWN-BY-ADDR": { | ||
"summary": "Determines whether a primary instance is down.", | ||
"complexity": "O(1)", | ||
"group": "sentinel", | ||
"since": "8.0.0", | ||
"arity": 6, | ||
"container": "SENTINEL", | ||
"function": "sentinelCommand", | ||
"command_flags": [ | ||
"ADMIN", | ||
"SENTINEL", | ||
"ONLY_SENTINEL" | ||
], | ||
"reply_schema": { | ||
"type": "array", | ||
"minItems": 3, | ||
"maxItems": 3, | ||
"items": [ | ||
{ | ||
"oneOf": [ | ||
{ | ||
"const": 0, | ||
"description": "Primary is up." | ||
}, | ||
{ | ||
"const": 1, | ||
"description": "Primary is down." | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "string", | ||
"description": "Sentinel address." | ||
}, | ||
{ | ||
"type": "integer", | ||
"description": "Port." | ||
} | ||
] | ||
}, | ||
"arguments": [ | ||
{ | ||
"name": "ip", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "port", | ||
"type": "integer" | ||
}, | ||
{ | ||
"name": "current-epoch", | ||
"type": "integer" | ||
}, | ||
{ | ||
"name": "runid", | ||
"type": "string" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"PRIMARIES": { | ||
"summary": "Returns a list of monitored primaries.", | ||
"complexity": "O(N) where N is the number of primaries", | ||
"group": "sentinel", | ||
"since": "8.0.0", | ||
"arity": 2, | ||
"container": "SENTINEL", | ||
"function": "sentinelCommand", | ||
"command_flags": [ | ||
"ADMIN", | ||
"SENTINEL", | ||
"ONLY_SENTINEL" | ||
], | ||
"reply_schema": { | ||
"type": "array", | ||
"description": "List of monitored primaries, and their states.", | ||
"items": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"PRIMARY": { | ||
"summary": "Returns the state of a primary instance.", | ||
"complexity": "O(1)", | ||
"group": "sentinel", | ||
"since": "8.0.0", | ||
"arity": 3, | ||
"container": "SENTINEL", | ||
"function": "sentinelCommand", | ||
"command_flags": [ | ||
"ADMIN", | ||
"SENTINEL", | ||
"ONLY_SENTINEL" | ||
], | ||
"reply_schema": { | ||
"type": "object", | ||
"description": "The state and info of the specified primary.", | ||
"additionalProperties": { | ||
"type": "string" | ||
} | ||
}, | ||
"arguments": [ | ||
{ | ||
"name": "primary-name", | ||
"type": "string" | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.