You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding basic version of DUMP and RESTORE commands (#899)
* Implement basic version of DUMP and RESTORE redis commands
* refactor and add dump, restore to cluster slot verification test
* Update comments to use 'RESP' encoding terminology
* fix formating
* fix tests
* add acl and tests and update default config to include the skip checksum
validation flag
* rm accidentally commited dump.rdb file
* Remove trailing whitespace in RespCommandTests.cs
* fix comments
* run CommandInfoUpdater and replace docs / info files
* Remove trailing whitespace in Options.cs
* fix RestoreACLsAsync test
* fix comments
* optimize RespLengthEncodingUtils
* implement suggestions
* fix comments
* use SET_Conditional directly
* rename SkipChecksumValidation
* fix cluster restore test
* directly write to the output buffer for non-large objects
* Refactor WriteDirect call in KeyAdminCommands
* Mark multiple commands as deprecated in JSON
* Mark commands as deprecated in documentation
---------
Co-authored-by: Badrish Chandramouli <[email protected]>
Copy file name to clipboardexpand all lines: libs/host/Configuration/Options.cs
+6-1
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
// Copyright (c) Microsoft Corporation.
1
+
// Copyright (c) Microsoft Corporation.
2
2
// Licensed under the MIT license.
3
3
4
4
usingSystem;
@@ -512,6 +512,10 @@ internal sealed class Options
512
512
[Option("fail-on-recovery-error",Default=false,Required=false,HelpText="Server bootup should fail if errors happen during bootup of AOF and checkpointing")]
[Option("lua-memory-management-mode",Default=LuaMemoryManagementMode.Native,Required=false,HelpText="Memory management mode for Lua scripts, must be set to LimittedNative or Managed to impose script limits")]
Copy file name to clipboardexpand all lines: libs/resources/RespCommandsDocs.json
+44
Original file line number
Diff line number
Diff line change
@@ -1698,6 +1698,22 @@
1698
1698
"Group": "Transactions",
1699
1699
"Complexity": "O(N), when N is the number of queued commands"
1700
1700
},
1701
+
{
1702
+
"Command": "DUMP",
1703
+
"Name": "DUMP",
1704
+
"Summary": "Returns a serialized representation of the value stored at a key.",
1705
+
"Group": "Generic",
1706
+
"Complexity": "O(1) to access the key and additional O(N*M) to serialize it, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)\u002BO(1*M) where M is small, so simply O(1).",
1707
+
"Arguments": [
1708
+
{
1709
+
"TypeDiscriminator": "RespCommandKeyArgument",
1710
+
"Name": "KEY",
1711
+
"DisplayText": "key",
1712
+
"Type": "Key",
1713
+
"KeySpecIndex": 0
1714
+
}
1715
+
]
1716
+
},
1701
1717
{
1702
1718
"Command": "ECHO",
1703
1719
"Name": "ECHO",
@@ -5429,6 +5445,34 @@
5429
5445
}
5430
5446
]
5431
5447
},
5448
+
{
5449
+
"Command": "RESTORE",
5450
+
"Name": "RESTORE",
5451
+
"Summary": "Creates a key from the serialized representation of a value.",
5452
+
"Group": "Generic",
5453
+
"Complexity": "O(1) to create the new key and additional O(N*M) to reconstruct the serialized value, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)\u002BO(1*M) where M is small, so simply O(1). However for sorted set values the complexity is O(N*M*log(N)) because inserting values into sorted sets is O(log(N)).",
Copy file name to clipboardexpand all lines: libs/server/Resp/CmdStrings.cs
+1
Original file line number
Diff line number
Diff line change
@@ -231,6 +231,7 @@ static partial class CmdStrings
231
231
publicstaticReadOnlySpan<byte>RESP_ERR_INCR_SUPPORTS_ONLY_SINGLE_PAIR=>"ERR INCR option supports a single increment-element pair"u8;
232
232
publicstaticReadOnlySpan<byte>RESP_ERR_INVALID_BITFIELD_TYPE=>"ERR Invalid bitfield type. Use something like i16 u8. Note that u64 is not supported but i64 is"u8;
233
233
publicstaticReadOnlySpan<byte>RESP_ERR_SCRIPT_FLUSH_OPTIONS=>"ERR SCRIPT FLUSH only support SYNC|ASYNC option"u8;
234
+
publicstaticReadOnlySpan<byte>RESP_ERR_BUSSYKEY=>"BUSYKEY Target key name already exists."u8;
234
235
publicstaticReadOnlySpan<byte>RESP_ERR_LENGTH_AND_INDEXES=>"If you want both the length and indexes, please just use IDX."u8;
235
236
publicstaticReadOnlySpan<byte>RESP_ERR_INVALID_EXPIRE_TIME=>"ERR invalid expire time, must be >= 0"u8;
236
237
publicstaticReadOnlySpan<byte>RESP_ERR_HCOLLECT_ALREADY_IN_PROGRESS=>"ERR HCOLLECT scan already in progress"u8;
0 commit comments