Skip to content

The KEYS command needs to be keyless #3341

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Dltmd202
Copy link
Contributor

@Dltmd202 Dltmd202 commented Jun 29, 2025

The KEYS command needs to be keyless

The request policy of the KEYS command specifies that the command should have a request_policy:all_shards.

127.0.0.1:6379> COMMAND INFO KEYS
    1)  1) "keys"
    2) (integer) 2
    3) 1) readonly
    4) (integer) 0
    5) (integer) 0
    6) (integer) 0
    7) 1) @keyspace
       2) @read
       3) @slow
       4) @dangerous
    8) 1) "request_policy:all_shards"
       2) "nondeterministic_output_order"
    9) (empty array)
   10) (empty array)

As such the parameters of the command should be considered keyless and the routing should be done to all nodes. Right now we have a K key parameter, which would assume that we need it for routing.

The underlying logic does route (in multi-shard environments) the command to all shards, but it still treats the parameter as a key for the purposes of serialization.

This is somewhat invalid if a user configures their own codec, because it requires that they treat keys and patterns with the same abstraction.

Closes #3311

Make sure that:

  • You have read the contribution guidelines.
  • You have created a feature request first to discuss your contribution intent. Please reference the feature request ticket number in the pull request.
  • You applied code formatting rules using the mvn formatter:format target. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.

@Dltmd202 Dltmd202 force-pushed the topic/Dltmd202/issue-3311 branch from bb9b5e8 to d49dd31 Compare June 29, 2025 17:00
@Dltmd202 Dltmd202 marked this pull request as ready for review June 30, 2025 01:59
@Dltmd202
Copy link
Contributor Author

Hi @tishun, could you please take a look at this PR when you have a moment?

@tishun tishun added this to the 7.0.0.RELEASE milestone Jul 14, 2025
@tishun tishun added the type: breaking Breaking change label Jul 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: breaking Breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The KEYS command needs to be keyless
2 participants