feat: Add support of the command Migrate#2863
Open
clouder-zhai wants to merge 2 commits intoapache:unstablefrom
Open
feat: Add support of the command Migrate#2863clouder-zhai wants to merge 2 commits intoapache:unstablefrom
clouder-zhai wants to merge 2 commits intoapache:unstablefrom
Conversation
45680b6 to
c862ea1
Compare
PragmaTwice
reviewed
Apr 1, 2025
Comment on lines
+1267
to
+1268
| static Status DumpKey(engine::Context &ctx, Server *srv, Connection *conn, std::string &key, | ||
| std::string &dump_result) { |
Member
There was a problem hiding this comment.
Suggested change
| static Status DumpKey(engine::Context &ctx, Server *srv, Connection *conn, std::string &key, | |
| std::string &dump_result) { | |
| static StatusOr<std::string> DumpKey(engine::Context &ctx, Server *srv, Connection *conn, std::string &key) { |
Author
There was a problem hiding this comment.
when I run ./x.py format, it automatically becomes two lines
Member
There was a problem hiding this comment.
I mean we can use StatusOr here instead of Status.
PragmaTwice
reviewed
Apr 1, 2025
PragmaTwice
reviewed
Apr 1, 2025
| MakeCmdAttr<CommandDump>("dump", 2, "read-only", 1, 1, 1), | ||
| MakeCmdAttr<CommandPollUpdates>("pollupdates", -2, "read-only admin", NO_KEY), ) | ||
| MakeCmdAttr<CommandPollUpdates>("pollupdates", -2, "read-only admin", NO_KEY), | ||
| MakeCmdAttr<CommandMigrate>("migrate", -6, "write", 1, 1, 1)) |
Member
There was a problem hiding this comment.
Suggested change
| MakeCmdAttr<CommandMigrate>("migrate", -6, "write", 1, 1, 1)) | |
| MakeCmdAttr<CommandMigrate>("migrate", 6, "write", 1, 1, 1)) |
Member
There was a problem hiding this comment.
Also the key position spec is wrong (1,1,1).
c862ea1 to
62dfd77
Compare
PragmaTwice
reviewed
Apr 2, 2025
| MakeCmdAttr<CommandDump>("dump", 2, "read-only", 1, 1, 1), | ||
| MakeCmdAttr<CommandPollUpdates>("pollupdates", -2, "read-only admin", NO_KEY), ) | ||
| MakeCmdAttr<CommandPollUpdates>("pollupdates", -2, "read-only admin", NO_KEY), | ||
| MakeCmdAttr<CommandMigrate>("migrate", -6, "write", 1, -1, 1)) |
Member
There was a problem hiding this comment.
1, -1, 1 means that all arguments are keys, which is obviously not correct here.
You can refer to here for how to generate dynamic key ranges: https://github.com/apache/kvrocks/blob/unstable/src/commands/cmd_zset.cc#L1552
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close #1949
Command Desc:
Redis doc: https://redis.io/docs/latest/commands/migrate/