Skip to content

Conversation

@Kiminni
Copy link
Contributor

@Kiminni Kiminni commented Oct 2, 2025

Description

This PR adds 8 JSON read-only commands to the ReadOnlyCommands list to ensure proper replica routing for RedisJSON operations.

Changes

ReadOnlyCommands.java

  • Added JSON read-only commands to CommandName enum:
    • JSON_ARRINDEX
    • JSON_ARRLEN
    • JSON_GET
    • JSON_MGET
    • JSON_OBJKEYS
    • JSON_OBJLEN
    • JSON_STRLEN
    • JSON_TYPE

ClusterReadOnlyCommandsUnitTests.java

  • Updated test count from 84 to 92 (reflecting 8 new commands)
  • Improved enum name conversion logic for commands with dots (e.g., "JSON.GET" → "JSON_GET")

Testing

  • All existing tests pass
  • New JSON commands are properly recognized as read-only
  • Enum name conversion works correctly for dot-containing command names

Related Issues

Resolves #3458: Extend the list of read-only commands with JSON read-only commands

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.

@jit-ci
Copy link

jit-ci bot commented Oct 2, 2025

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

…rver or the information about it could not be parsed
@tishun tishun added the type: improvement An improvement to the existing implementation label Oct 3, 2025
@tishun tishun added this to the 7.0.0.RELEASE milestone Oct 3, 2025
Copy link
Collaborator

@tishun tishun left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the contribution!

@tishun tishun merged commit 5b6e95a into redis:main Oct 3, 2025
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: improvement An improvement to the existing implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend the list of read-only commands with JSON read-only commands

2 participants