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

Implement the atomic DEL command in Scylla to support the multiple keys. #5334

Closed
fastio opened this issue Nov 23, 2019 · 2 comments
Closed

Comments

@fastio
Copy link
Contributor

fastio commented Nov 23, 2019

The current implementation of Redis DEL command in Scylla does not support to delete multiple keys.
It should support delete multiple keys atomically, return the number of actually deleted keys.

As @nyh mentioned in the Redis API in Scylla , there features should be supported eventually.

@fastio fastio changed the title Implement the atomic DEL command to support the multiple keys. Implement the atomic DEL command in Scylla to support the multiple keys. Nov 23, 2019
@nyh
Copy link
Contributor

nyh commented Nov 23, 2019

@fastio, what did you mean "delete multiple keys atomically" - if one of them is missing, none of the deletes are done? Is this a Redis feature?
I'm aware of two things that the current code is missing, please correct me if this is the wrong list:

  1. We need to support the syntax of deleting multiple keys in one DEL command.
  2. We need to support DEL's feature of returning the number of really deleted keys. I don't know how we can do this efficiently, as this requires a read-before-write (LWT, if we want to be really consistent), which will significantly slow us down. I wonder how often users actually use the return value of DEL, and if they don't often do - maybe it makes sense to have an option to not support it.

@fastio
Copy link
Contributor Author

fastio commented Nov 24, 2019

@fastio, what did you mean "delete multiple keys atomically" - if one of them is missing, none of the deletes are done? Is this a Redis feature?

Sorry, It's a mistake here. I want say that we can delete multiple keys at once using the DEL command of Redis. In the Redis implementation, the DEL command does not remove multiple keys
atomically. The command returns the number of removed keys in the operation.

I'm aware of two things that the current code is missing, please correct me if this is the wrong list:

  1. We need to support the syntax of deleting multiple keys in one DEL command.
  2. We need to support DEL's feature of returning the number of really deleted keys.
    I don't know how we can do this efficiently, as this requires a read-before-write (LWT, if we want to be really consistent), which will significantly slow us down. I wonder how often users actually use the return value of DEL, and if they don't often do - maybe it makes sense to have an option to not support it.

You are right. I agree with you. I think users are concerned about whether the keys are deleted correctly in most use scenarios.

@nyh, So we do not support the second feature that the DEL command returns the count of really deleted keys, and only support the syntax of deleting multiple keys in one command. If having an efficient way to implement it in the future, we will support this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants