-
Notifications
You must be signed in to change notification settings - Fork 703
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 cluster flushslot command. #1384
base: unstable
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #1384 +/- ##
============================================
+ Coverage 70.80% 70.98% +0.17%
============================================
Files 121 121
Lines 65132 65149 +17
============================================
+ Hits 46118 46243 +125
+ Misses 19014 18906 -108
|
Please help review this PR. Thank you. @hwware @madolson @PingXie @zuiderkwast |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall. Thanks @wuranxx!
addReplyErrorObject(c, shared.syntaxerr); | ||
return; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should fail the c->argc > 4
case I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the call site of clusterCommandFlushslot
, I have already performed a check on the number of parameters. Is it still necessary to validate the number of parameters again within the function?
else if (!strcasecmp(c->argv[1]->ptr, "flushslot") && (c->argc == 3 || c->argc == 4)) {
/* CLUSTER FLUSHSLOT <slot> [ASYNC|SYNC] */
clusterCommandFlushslot(c);
}
c66cb6a
to
ab74efb
Compare
Before I rebased to the latest unstable (old commit is 32f7541) , the Tcl tests and manual command tests ran fine locally. After I rebased to the latest unstable 6df376d, the command failed when executed locally. It is possible that changes in the code during this period caused the inconsistent behavior. Until I confirm the cause, I have marked this PR as WIP (Work In Progress). |
Signed-off-by: wuranxx <[email protected]>
Signed-off-by: wuranxx <[email protected]>
Signed-off-by: wuranxx <[email protected]>
Signed-off-by: wuranxx <[email protected]>
ab74efb
to
4db74af
Compare
Fixed. For details, see #1399. |
@enjoy-binbin @murphyjacob4 Do you want this command for atomic slot migration, for example when a slot migration is cancelled, the importing node can send CLUSTER FLUSHSLOT to its replicas to clean up the slot? |
I think we will have a protocol for cancelling the slot migration, and this will trigger the drop for all slot ranges being migrated locally. But we should be able to use the async |
@murphyjacob4 The replicas are not involved in the slot migration protocol IIUC. So when a primary cleans up a cancelled slot import, do you just replicate a lot of DEL commands to the replicas? Replicating a single FLUSHSLOT may save some work and bandwidth... |
Yeah that's a good idea. Currently, this is what |
add cluster flushslot command. #1133
background
We want to implement the ability to SYNC or ASYNC free all data from a single slot. This is useful in two cases:
behavior
Add
CLUSTER FLUSHSLOT <slot> [ASYNC|SYNC]
command.Modify the function signature of
delKeysInSlot
, adding alazy
parameter to decide whether to delete keys SYNC or ASYNC.