Skip to content
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

[Feature] Implement CLUSTER FLUSHSLOT command #1133

Open
madolson opened this issue Oct 7, 2024 · 5 comments
Open

[Feature] Implement CLUSTER FLUSHSLOT command #1133

madolson opened this issue Oct 7, 2024 · 5 comments
Labels
enhancement New feature or request help wanted External contributions would be appreciated major-decision-approved Major decision approved by TSC team

Comments

@madolson
Copy link
Member

madolson commented Oct 7, 2024

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:

  1. When a primary loses ownership of a slot, it will temporarily freeze while it synchronously frees the slot.
  2. 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:

unsigned int delKeysInSlot(unsigned int hashslot) {

Alternative naming conventions:

  1. SFLUSH (presumably slot flush). The S prefix is also used for set, so it may not make the most sense to emulate.
  2. FLUSHSLOT. Since this is mostly be an admin command, it might make sense to attach the cluster.
@madolson madolson added enhancement New feature or request help wanted External contributions would be appreciated labels Oct 7, 2024
@PingXie PingXie added the major-decision-pending Major decision pending by TSC team label Oct 7, 2024
@PingXie
Copy link
Member

PingXie commented Oct 7, 2024

I like this idea. Added major-decision-pending since this is a new command and +@valkey-io/core-team

@ranshid
Copy link
Member

ranshid commented Oct 7, 2024

@PingXie @madolson In case we will decide to go ahead, we will be happy to take it

@zuiderkwast
Copy link
Contributor

1 and 2 are separate features? I believe 1 is not an API change. It suggest we let it be controlled by the existing lazyfree config lazyfree-lazy-server-del.

@hwware
Copy link
Member

hwware commented Oct 7, 2024

I prefer naming it as CLUSTER FLUSHSLOT, because it only works in cluster mode, and it should run as asynchronous natively, right? Because for the similar command name FLUSHALL, it could run as ASYNC(default) and SYNC.

@madolson madolson changed the title [Feature] Implement FLUSHSLOT command [Feature] Implement CLUSTER FLUSHSLOT command Oct 7, 2024
@madolson madolson added major-decision-approved Major decision approved by TSC team and removed major-decision-pending Major decision pending by TSC team labels Oct 7, 2024
@madolson
Copy link
Member Author

madolson commented Oct 7, 2024

Note from core meeting. We can split this into two PRs, one for command and one for the improved flush behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted External contributions would be appreciated major-decision-approved Major decision approved by TSC team
Projects
Status: Idea
Development

No branches or pull requests

5 participants