-
Notifications
You must be signed in to change notification settings - Fork 472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the support of the blocking migration for the cluster migrate command #1350
Comments
I recommend that bmirate support bulk slot migration |
How about adding the optional
|
I agree. |
Thanks to @git-hulk and @xiaobiaozhao . This is a good workaround to not create a new subcommand and to provide backward compatibility. However, I have to mention this: the "OK" returned by If this is acceptable, then I am ready to implement it. |
@ellutionist Thanks for your points. To be clear, we can also explicitly add the ASYNC|SYNC flag to identify the mode? And the timeout is only meaningful when the SYNC flag is exists. How do you think? |
To see other folks have any comments. @xiaobiaozhao @PragmaTwice @torwig @ShooterIT @caipengbo |
As I think, an ASYNC|SYNC flag is best choice and will be using in some other commands, like BACKUP. |
I respect the reasoning about introducing a separate command for a blocking version of the command: it's clearer, descriptive and consistent with some naming conventions of Redis (e. g. POP/BPOP). |
I agree with @torwig . A new subcommand is a more clear and more "redis" solution to me. |
Thanks, @ellutionist @torwig @xiaobiaozhao @aleksraiden. So our consensus is to use |
I prefer to use SYNC|ASYNC flag instead of another command which has similar arguments check and logic. For |
Agree with it. |
+1 |
vote for the SYNC|ASYNC flag |
Looks like the option of
|
I think it is unrelated to this PR. Besides, it is better to implement these two different features in two separate PRs. |
Search before asking
Motivation
For now the command to migrate slot
clusterx migrate
works asynchronously. It will return "OK" right after the migration has started. If the client wants to know the result of the migration, it has to constantly use "cluster info" to get the state.However, once the migration has been completed, the target slot will be forbidden, and the client (cluster manager) has to actively change the topology as soon as possible, in order to make the cluster continue to work.
In summary, the current
clusterx migrate
has two shortcuts:Solution
I propose to leave the old
clusterx migrate
command intact, and add a newclusterx bmirate
command, which works like other blocking commands (e.g.blpop
). The server will block the connection and return "OK" (if succeed) or other error message (if failed) to the client only after the migration has completed.The command shall be like:
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: