Skip to content

MOD-18952 Fix MGET command key spec - #1648

Merged
AvivDavid23 merged 2 commits into
masterfrom
MOD-18953-fix-mget-command-key-spec
Sep 28, 2026
Merged

AvivDavid23 merged 2 commits into
masterfrom
MOD-18953-fix-mget-command-key-spec

Conversation

@AvivDavid23

@AvivDavid23 AvivDavid23 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Note

Low Risk
Metadata-only key-spec fix with new COMMAND GETKEYS/INFO tests; MGET execution logic is unchanged.

Overview
Corrects JSON.MGET Redis 7 key spec metadata so introspection matches the real argument layout: one or more keys, then a single path as the last argument.

The find_keys range is updated from last_key: 0 to last_key: -2, so COMMAND GETKEYS / COMMAND INFO treat every key argument as a key and exclude the trailing path. Runtime MGET parsing was already keys = args[1..len-1]; this aligns module metadata with that behavior for cluster routing, ACL key rules, and similar server features.

Tests add test_command_json_mget_key_spec (GETKEYS across key counts and paths, plus key-spec shape), and adjust a few MGET calls to use hash tags where cluster tests need them.

Reviewed by Cursor Bugbot for commit 8b387c0. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov

codecov Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.97%. Comparing base (21d4cdd) to head (8b387c0).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1648   +/-   ##
=======================================
  Coverage   85.97%   85.97%           
=======================================
  Files          15       15           
  Lines        5306     5306           
=======================================
  Hits         4562     4562           
  Misses        744      744           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

gabsow
gabsow previously approved these changes Sep 28, 2026
@gabsow
gabsow self-requested a review September 28, 2026 07:10
group="module",
)

def test_command_json_mget_key_spec(self):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

test is failing in CI

@gabsow gabsow left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

test is failing in CI

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8b387c0. Configure here.

Comment thread tests/pytest/test_cmd_info.py Resolved
@AvivDavid23
AvivDavid23 merged commit ac573d8 into master Sep 28, 2026
59 of 60 checks passed
@AvivDavid23
AvivDavid23 deleted the MOD-18953-fix-mget-command-key-spec branch September 28, 2026 08:36
AvivDavid23 added a commit that referenced this pull request Sep 28, 2026
* MOD-18952 Fix MGET command key spec (#1648)

* MOD-18952 Fix MGET command key spec

* fix tests

* MOD-18751: waive cluster bus protected mode for the oss-cluster phase (#1644)

* MOD-18751: waive cluster bus protected mode for the oss-cluster phase

redis/redis#15722 added cluster-bus-port-protected-mode, and on the 8.12 line it
defaults to enabled: a node started with cluster-enabled and without tls-cluster
then refuses to start, because its cluster bus port would be unauthenticated.
That is how the oss-cluster phase is built, so every shard dies at startup and
each test fails at connect with "Connection refused". The refusal happens while
the configuration is validated, before the server opens its logfile, so the
retained logs are empty and say nothing about the cause.

Waive it for that phase. The bus ports here are bound to localhost on an
ephemeral host, which is the condition the directive documents for waiving, and
they were equally unauthenticated before the redis change - which only made
running them an explicit choice.

The option is not passed blind, because a redis that does not have it rejects
the directive and fails to start the same way. RLTest takes it as an option
rather than guessing, since nothing it can see distinguishes a build that has
the option from one that does not: the 8.12 line reports 8.9.241 in version.h,
the same as builds from before the change. CLUSTER_BUS_PROTECTED_MODE= omits it
for anyone running the cluster phase against an older redis locally.

The tls_cluster phase is left alone, since tls-cluster authenticates the bus,
and so is the existing-env phase, where RLTest starts no servers.

Requires RLTest with the option (RedisLabsModules/RLTest#255).

* Trigger CI to build the image locally, so it installs RLTest 0.7.29

* Set CLUSTER_BUS_ARGS before the ENV_ONLY branch can use it

run_env interpolates CLUSTER_BUS_ARGS for COORD=oss, but the ENV_ONLY branch
calls run_env and exits 20 lines before the assignment, so that path started
its cluster without the waiver and the shards refused to start on 8.12.

Moving the assignment above the branch; it depends on nothing in between.

Co-Authored-By: Claude Opus 5 <[email protected]>

---------

Co-authored-by: Claude Opus 5 <[email protected]>

---------

Co-authored-by: LiranAbir <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
AvivDavid23 added a commit that referenced this pull request Sep 28, 2026
* MOD-18952 Fix MGET command key spec (#1648)

* MOD-18952 Fix MGET command key spec

* fix tests

* MOD-18751: waive cluster bus protected mode for the oss-cluster phase (#1644)

* MOD-18751: waive cluster bus protected mode for the oss-cluster phase

redis/redis#15722 added cluster-bus-port-protected-mode, and on the 8.12 line it
defaults to enabled: a node started with cluster-enabled and without tls-cluster
then refuses to start, because its cluster bus port would be unauthenticated.
That is how the oss-cluster phase is built, so every shard dies at startup and
each test fails at connect with "Connection refused". The refusal happens while
the configuration is validated, before the server opens its logfile, so the
retained logs are empty and say nothing about the cause.

Waive it for that phase. The bus ports here are bound to localhost on an
ephemeral host, which is the condition the directive documents for waiving, and
they were equally unauthenticated before the redis change - which only made
running them an explicit choice.

The option is not passed blind, because a redis that does not have it rejects
the directive and fails to start the same way. RLTest takes it as an option
rather than guessing, since nothing it can see distinguishes a build that has
the option from one that does not: the 8.12 line reports 8.9.241 in version.h,
the same as builds from before the change. CLUSTER_BUS_PROTECTED_MODE= omits it
for anyone running the cluster phase against an older redis locally.

The tls_cluster phase is left alone, since tls-cluster authenticates the bus,
and so is the existing-env phase, where RLTest starts no servers.

Requires RLTest with the option (RedisLabsModules/RLTest#255).

* Trigger CI to build the image locally, so it installs RLTest 0.7.29

* Set CLUSTER_BUS_ARGS before the ENV_ONLY branch can use it

run_env interpolates CLUSTER_BUS_ARGS for COORD=oss, but the ENV_ONLY branch
calls run_env and exits 20 lines before the assignment, so that path started
its cluster without the waiver and the shards refused to start on 8.12.

Moving the assignment above the branch; it depends on nothing in between.

Co-Authored-By: Claude Opus 5 <[email protected]>

---------

Co-authored-by: Claude Opus 5 <[email protected]>

---------

Co-authored-by: LiranAbir <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
AvivDavid23 added a commit that referenced this pull request Sep 28, 2026
* MOD-18952 Fix MGET command key spec (#1648)

* MOD-18952 Fix MGET command key spec

* fix tests

* MOD-18751: waive cluster bus protected mode for the oss-cluster phase (#1644)

* MOD-18751: waive cluster bus protected mode for the oss-cluster phase

redis/redis#15722 added cluster-bus-port-protected-mode, and on the 8.12 line it
defaults to enabled: a node started with cluster-enabled and without tls-cluster
then refuses to start, because its cluster bus port would be unauthenticated.
That is how the oss-cluster phase is built, so every shard dies at startup and
each test fails at connect with "Connection refused". The refusal happens while
the configuration is validated, before the server opens its logfile, so the
retained logs are empty and say nothing about the cause.

Waive it for that phase. The bus ports here are bound to localhost on an
ephemeral host, which is the condition the directive documents for waiving, and
they were equally unauthenticated before the redis change - which only made
running them an explicit choice.

The option is not passed blind, because a redis that does not have it rejects
the directive and fails to start the same way. RLTest takes it as an option
rather than guessing, since nothing it can see distinguishes a build that has
the option from one that does not: the 8.12 line reports 8.9.241 in version.h,
the same as builds from before the change. CLUSTER_BUS_PROTECTED_MODE= omits it
for anyone running the cluster phase against an older redis locally.

The tls_cluster phase is left alone, since tls-cluster authenticates the bus,
and so is the existing-env phase, where RLTest starts no servers.

Requires RLTest with the option (RedisLabsModules/RLTest#255).

* Trigger CI to build the image locally, so it installs RLTest 0.7.29

* Set CLUSTER_BUS_ARGS before the ENV_ONLY branch can use it

run_env interpolates CLUSTER_BUS_ARGS for COORD=oss, but the ENV_ONLY branch
calls run_env and exits 20 lines before the assignment, so that path started
its cluster without the waiver and the shards refused to start on 8.12.

Moving the assignment above the branch; it depends on nothing in between.

Co-Authored-By: Claude Opus 5 <[email protected]>

---------

Co-authored-by: Claude Opus 5 <[email protected]>

---------

Co-authored-by: LiranAbir <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
AvivDavid23 added a commit that referenced this pull request Sep 28, 2026
* MOD-18952 Fix MGET command key spec (#1648)

* MOD-18952 Fix MGET command key spec

* fix tests

* MOD-18751: waive cluster bus protected mode for the oss-cluster phase (#1644)

* MOD-18751: waive cluster bus protected mode for the oss-cluster phase

redis/redis#15722 added cluster-bus-port-protected-mode, and on the 8.12 line it
defaults to enabled: a node started with cluster-enabled and without tls-cluster
then refuses to start, because its cluster bus port would be unauthenticated.
That is how the oss-cluster phase is built, so every shard dies at startup and
each test fails at connect with "Connection refused". The refusal happens while
the configuration is validated, before the server opens its logfile, so the
retained logs are empty and say nothing about the cause.

Waive it for that phase. The bus ports here are bound to localhost on an
ephemeral host, which is the condition the directive documents for waiving, and
they were equally unauthenticated before the redis change - which only made
running them an explicit choice.

The option is not passed blind, because a redis that does not have it rejects
the directive and fails to start the same way. RLTest takes it as an option
rather than guessing, since nothing it can see distinguishes a build that has
the option from one that does not: the 8.12 line reports 8.9.241 in version.h,
the same as builds from before the change. CLUSTER_BUS_PROTECTED_MODE= omits it
for anyone running the cluster phase against an older redis locally.

The tls_cluster phase is left alone, since tls-cluster authenticates the bus,
and so is the existing-env phase, where RLTest starts no servers.

Requires RLTest with the option (RedisLabsModules/RLTest#255).

* Trigger CI to build the image locally, so it installs RLTest 0.7.29

* Set CLUSTER_BUS_ARGS before the ENV_ONLY branch can use it

run_env interpolates CLUSTER_BUS_ARGS for COORD=oss, but the ENV_ONLY branch
calls run_env and exits 20 lines before the assignment, so that path started
its cluster without the waiver and the shards refused to start on 8.12.

Moving the assignment above the branch; it depends on nothing in between.

Co-Authored-By: Claude Opus 5 <[email protected]>

---------

Co-authored-by: Claude Opus 5 <[email protected]>

---------

Co-authored-by: LiranAbir <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants