valkey
valkey copied to clipboard
[Feature] Implement CLUSTER FLUSHSLOT command
As part of the per-slot dictionary effort, we implemented all of the needed changes so that we could efficiently unlink and free the data in a single slot with lazyfree. This is useful in two cases:
- When a primary loses ownership of a slot, it will temporarily freeze while it synchronously frees the slot.
- When doing resharding, you may prefer to forcibly delete all the data from a slot and assign it to another node.
The main point where code needs to be updated: https://github.com/valkey-io/valkey/blob/b5eb7930797023f46331d68b964b3871625da79d/src/cluster_legacy.c#L6040
Alternative naming conventions (Naming was finalized, leaving for historical purposes):
-
SFLUSH
(presumably slot flush). The S prefix is also used for set, so it may not make the most sense to emulate. -
FLUSHSLOT
. Since this is mostly be an admin command, it might make sense to attach the cluster.