-
Notifications
You must be signed in to change notification settings - Fork 694
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new SCRIPT SHOW subcommand to dump script via sha1 (#617)
In some scenarios, the business may not be able to find the previously used Lua script and only have a SHA signature. Or there are multiple identical evalsha's args in monitor/slowlog, and admin is not able to distinguish the script body. Add a new script subcommmand to show the contents of script given the scripts sha1. Returns a NOSCRIPT error if the script is not present in the cache. Usage: `SCRIPT SHOW sha1` Complexity: `O(1)` Closes #604. Doc PR: valkey-io/valkey-doc#143 --------- Signed-off-by: wei.kukey <wei.kukey@gmail.com> Signed-off-by: Madelyn Olson <madelyneolson@gmail.com> Co-authored-by: Madelyn Olson <madelyneolson@gmail.com> Co-authored-by: Binbin <binloveplay1314@qq.com> Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
- Loading branch information
1 parent
be2c321
commit ae2d421
Showing
5 changed files
with
78 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"SHOW": { | ||
"summary": "Show server-side Lua script in the script cache.", | ||
"complexity": "O(1).", | ||
"group": "scripting", | ||
"since": "8.0.0", | ||
"arity": 3, | ||
"container": "SCRIPT", | ||
"function": "scriptCommand", | ||
"command_flags": [ | ||
"NOSCRIPT" | ||
], | ||
"acl_categories": [ | ||
"SCRIPTING" | ||
], | ||
"arguments": [ | ||
{ | ||
"name": "sha1", | ||
"type": "string" | ||
} | ||
], | ||
"reply_schema": { | ||
"description": "Lua script if sha1 hash exists in script cache.", | ||
"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