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 request: add a cluster-capable version of flushallAsync #1359

Closed
jchambers opened this issue Jul 21, 2020 · 2 comments
Closed

Feature request: add a cluster-capable version of flushallAsync #1359

jchambers opened this issue Jul 21, 2020 · 2 comments
Labels
type: feature A new feature
Milestone

Comments

@jchambers
Copy link
Contributor

RedisAdvancedClusterCommands has an implementation of flushall that will:

Remove all keys from all databases on all cluster masters with pipelining.

It does not, however, have a matching implementation of flushallAsync, which instead lives in the world of single-node commands. That can lead to some surprising behavior:

connection.sync().flushall(); // Clears the whole cluster, but blocks
connection.sync().flushallAsync(); // Clears just one shard of the cluster asynchronously

To be fair, there is a viable workaround:

connection.sync().masters().commands().flushallAsync(); // Clears the whole cluster asynchronously

…but it's very easy to fall into the trap of thinking you've cleared your whole cluster even if only one shard was cleared. I'm writing to suggest adding a cluster-capable version of flushallAsync() to RedisAdvancedClusterCommands and its async/reactive cousins.

@jchambers jchambers added the type: feature A new feature label Jul 21, 2020
@mp911de
Copy link
Collaborator

mp911de commented Jul 22, 2020

Great proposal. Do you want to submit a pull request?

@mp911de mp911de added the status: help-wanted An issue that a contributor can help us with label Jul 22, 2020
@jchambers
Copy link
Contributor Author

Sure. I may need some help understanding some plumbing, but I'll open a draft and we can work through the specifics there.

mp911de pushed a commit that referenced this issue Jul 29, 2020
flushallAsync gets now dispatched to all cluster nodes.

Original pull request: #1360.
mp911de added a commit that referenced this issue Jul 29, 2020
Add author and since tags. Simplify test.

Original pull request: #1360.
mp911de pushed a commit that referenced this issue Jul 29, 2020
flushallAsync gets now dispatched to all cluster nodes.

Original pull request: #1360.
mp911de added a commit that referenced this issue Jul 29, 2020
Add author and since tags. Simplify test.

Original pull request: #1360.
mp911de added a commit that referenced this issue Jul 29, 2020
Add final keyword where possible. Remove unused code.
mp911de added a commit that referenced this issue Jul 29, 2020
Add final keyword where possible. Remove unused code.
@mp911de mp911de removed the status: help-wanted An issue that a contributor can help us with label Jul 29, 2020
@mp911de mp911de added this to the 5.3.3 milestone Jul 29, 2020
@mp911de mp911de closed this as completed Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants