Skip to content

Migrate KEYS, SELECT, and ROLE commands to cluster scope infrastructure - #42481

Merged
nezdolik merged 11 commits into
envoyproxy:mainfrom
dinesh-murugiah:moveto_clusterscope_command
Dec 19, 2025
Merged

nezdolik merged 11 commits into
envoyproxy:mainfrom
dinesh-murugiah:moveto_clusterscope_command

Conversation

@dinesh-murugiah

@dinesh-murugiah dinesh-murugiah commented Dec 9, 2025 •

Copy link
Copy Markdown
Contributor

Migrate KEYS, SELECT, and ROLE commands to cluster scope infrastructure

Changes

1. Migrated three commands to unified cluster scope handling:

  • KEYS: Moved to ArrayMergeAggregateResponseHandler - merges array responses from all shards
  • SELECT: Moved to AllshardSameResponseHandler - validates all shards return same response
  • ROLE: Moved to new ArrayAppendAggregateResponseHandler - preserves per-shard array structure

2. Implemented ArrayAppendAggregateResponseHandler:

  • New handler for commands requiring per-shard response identity
  • Unlike ArrayMerge (flattens elements), this appends complete arrays: [["master",...], ["slave",...]]
  • Validates strict Array type only (removed unnecessary BulkString check)

3. Code cleanup:

  • Removed ~150 lines of duplicate handler implementations:
    • Deleted KeysRequest, SelectRequest, and RoleRequest classes
    • Removed special-case ROLE argument validation (now handled by shards)
    • Removed SELECT argument validation (upstream validation)
    • Removed unnecessary try-catch block in ArrayAppendAggregateResponseHandler

4. Test updates:

  • Replaced parameterized RoleHandlerTest with ClusterScopeRoleTest (9 test cases)
  • Removed RoleBulkStringResponse test (invalid scenario)
  • Removed SelectWrongNumberOfArgs test (validation now upstream)

Benefits

  • Reduced code duplication: Single infrastructure handles multiple commands
  • Improved maintainability: Reusable handlers vs command-specific implementations
  • Consistent behavior: All cluster scope commands follow same patterns
  • Better separation of concerns: Validation handled by Redis shards, proxy focuses on routing

@phlax

phlax commented Dec 9, 2025

Copy link
Copy Markdown
Member

could you fix DCO please @dinesh-murugiah

@dinesh-murugiah
dinesh-murugiah force-pushed the moveto_clusterscope_command branch from 4dc4575 to 1a44d75 Compare December 9, 2025 14:48
@dinesh-murugiah

Copy link
Copy Markdown
Contributor Author

@phlax done

@dinesh-murugiah

dinesh-murugiah commented Dec 10, 2025 •

Copy link
Copy Markdown
Contributor Author

/rerun

@dinesh-murugiah
dinesh-murugiah force-pushed the moveto_clusterscope_command branch from 7b183c3 to ad5be01 Compare December 10, 2025 16:07
@repokitteh-read-only repokitteh-read-only Bot added api deps Approval required for changes to Envoy's external dependencies labels Dec 10, 2025
@repokitteh-read-only

Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @mattklein123
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).
CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to (bazel/.*repos.*\.bzl)|(bazel/dependency_imports\.bzl)|(api/bazel/.*\.bzl)|(.*/requirements\.txt)|(.*\.patch).
envoyproxy/dependency-shepherds assignee is @phlax

🐱

Caused by: #42481 was synchronize by dinesh-murugiah.

see: more, trace.

@dinesh-murugiah

Copy link
Copy Markdown
Contributor Author

@mattklein123 @phlax a kind reminder

@phlax

phlax commented Dec 18, 2025

Copy link
Copy Markdown
Member

@nezdolik would you be able to take a look at this one

Comment thread changelogs/current.yaml Resolved
@nezdolik

Copy link
Copy Markdown
Member

LGTM, please fix DCO (sign the commits and force push)

nezdolik
nezdolik previously approved these changes Dec 19, 2025
@nezdolik
nezdolik merged commit 348d2fb into envoyproxy:main Dec 19, 2025
grnmeira pushed a commit to grnmeira/envoy that referenced this pull request Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api deps Approval required for changes to Envoy's external dependencies workflows:untested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants