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

Remove support for splitting multi-key commands per slot #23

Merged
merged 3 commits into from
Jun 28, 2024

Conversation

bjosv
Copy link
Collaborator

@bjosv bjosv commented Jun 22, 2024

  • Remove support for command splitting in cluster API
    Since old days (from hiredis-vip) there has been support for sending some commands that contains multiple keys, but which covers multiple slots. The client would split a command into multiple commands and send to each node handling each slot.
    This is unnecessary complex, so lets remove it in this early stage.

  • Refactor function that prepares cluster commands
    Rename and remove unnecessary checks in the internal function command_format_by_slot().

Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
Rename and remove unnecessary checks in internal function:
command_format_by_slot().

Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
@bjosv bjosv requested a review from zuiderkwast June 27, 2024 12:53
Copy link
Collaborator

@zuiderkwast zuiderkwast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great.

There's some clang-format issue.

I believe some users, at least of other clients in other languages, want this feature to do mass inserts. I don't think it's worth the complexity and the broken atomicity expectations though. If they want to do mass insertions, they can partition their keys by slot themselves (using valkeyClusterGetSlotByKey) and compose their own mset commands, or use some other tool for mass insertions.

src/command.c Show resolved Hide resolved
@bjosv bjosv merged commit 899ac88 into valkey-io:main Jun 28, 2024
41 of 43 checks passed
@bjosv bjosv deleted the remove-multislot-support branch June 28, 2024 08:05
michael-grunder pushed a commit to michael-grunder/libvalkey that referenced this pull request Aug 1, 2024
- Remove support for command splitting in cluster API
  Since old days (from hiredis-vip) there has been support for sending
  some commands that contains multiple keys, but which covers multiple
  slots. The client would split a command into multiple commands and send
  to each node handling each slot.
  This is unnecessary complex, so lets remove it in this early stage.

- Refactor function that prepares cluster commands    
  Rename and remove unnecessary checks in the internal function
  `command_format_by_slot()`.

Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
@bjosv bjosv added the breakingchange Indicates a possible backwards incompatible change label Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breakingchange Indicates a possible backwards incompatible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants