Support slot-based data migration#430
Merged
Merged
Conversation
added 2 commits
December 16, 2021 22:20
- Clear unnecessary option
- code optimization
Member
|
@ChrisZMF Please resolve conflicts (related to kvrocks2redis) |
ShooterIT
reviewed
Jan 13, 2022
git-hulk
reviewed
Jan 16, 2022
Member
|
Hi @ChrisZMF I have merge |
ShooterIT
reviewed
Jan 26, 2022
ShooterIT
reviewed
Jan 26, 2022
ShooterIT
reviewed
Jan 27, 2022
ShooterIT
reviewed
Jan 27, 2022
ShooterIT
reviewed
Jan 27, 2022
Member
|
Cheers! @ShooterIT I didn't have other suggestions, can you help to summary this PR. |
git-hulk
approved these changes
Jan 27, 2022
Contributor
Author
|
I am really glad this PR is accepted. Thank you for the suggestions you given for this PR to make it better. It really makes a lot of sense to me. @ShooterIT @git-hulk |
ShooterIT
pushed a commit
to ShooterIT/kvrocks
that referenced
this pull request
Jan 27, 2022
A new command CLUSTERX MIGRATE is used for migrate slot data, slot-based migration process mainly includes the following stages: migrating existing data and migrating incremental data. Command format: CLUSTERX MIGRATE $slot $dst_nodeid - $slot is the slot which is to migrate - $dst_nodeid is the node id of destination server in the cluster. We also introduce an internal command CLUSTER IMPORT for importing the migrating slot data into destination server. Migration status are shown into the output of CLUSTER INFO command. After migration slot, you also should use CLUSTERX SETSLOT command to change cluster slot distribution. For more details, please see apache#412 and apache#430
Merged
ShooterIT
pushed a commit
to ShooterIT/kvrocks
that referenced
this pull request
Jan 28, 2022
A new command CLUSTERX MIGRATE is used for migrate slot data, slot-based migration process mainly includes the following stages: migrating existing data and migrating incremental data. Command format: CLUSTERX MIGRATE $slot $dst_nodeid - $slot is the slot which is to migrate - $dst_nodeid is the node id of destination server in the cluster. We also introduce an internal command CLUSTER IMPORT for importing the migrating slot data into destination server. Migration status are shown into the output of CLUSTER INFO command. After migration slot, you also should use CLUSTERX SETSLOT command to change cluster slot distribution. For more details, please see apache#412 and apache#430
ShooterIT
pushed a commit
that referenced
this pull request
Jan 28, 2022
A new command CLUSTERX MIGRATE is used for migrate slot data, slot-based migration process mainly includes the following stages: migrating existing data and migrating incremental data. Command format: CLUSTERX MIGRATE $slot $dst_nodeid - $slot is the slot which is to migrate - $dst_nodeid is the node id of destination server in the cluster. We also introduce an internal command CLUSTER IMPORT for importing the migrating slot data into destination server. Migration status are shown into the output of CLUSTER INFO command. After migration slot, you also should use CLUSTERX SETSLOT command to change cluster slot distribution. For more details, please see #412 and #430
5 tasks
Comment on lines
+3470
to
+3473
| if (svr->GetConfig()->cluster_enabled) { | ||
| svr->slot_migrate_->SetMigrateStopFlag(false); | ||
| LOG(INFO) << "Change server role to master, restart migration task"; | ||
| } |
Member
There was a problem hiding this comment.
isn’t this block of code are dead code? since in the beginning we will throw an error if we are in the cluster mode
Status Execute(Server *svr, Connection *conn, std::string *output) override {
if (svr->GetConfig()->cluster_enabled) {
return Status(Status::RedisExecErr, "can't change to slave in cluster mode");
}
sorry for commenting in this very old PR... i tracked the changes, afraid i am missing something.
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.

resolves #412
Support Commands
$slot$dst_nodeid$dst_nodeidis the node id of destination server in the cluster. See [NEW] Support redis cluster mode [NEW] Support redis cluster mode #219 for more details.$slot$stateIt is an internal command which will be sent by the source server to notify the destination server to prepare for data importing. This command cannot be used by clients.
CLUSTER INFO.Example:
Source node info:
Destination node info:
After migration slot, you should use CLUSTERX SETSLOT #463 to change cluster slot distribution.