Skip to content

Commit 3fd4b23

Browse files
MOD-9909 Make CLUSTERSET visible again (#61)
Redis 8 introduced a new "internal" module flag which can be used to hide internal commands from COMMAND LIST. We need CLUSTERSET to remain visible in order for the cluster to identify a module as cluster-aware and update it upon topology changes, so this fix removed the "internal" flag from this specific command.
1 parent 0fd214f commit 3fd4b23

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/cluster.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1365,8 +1365,11 @@ int MR_ClusterInit(RedisModuleCtx* rctx, char *password) {
13651365
}
13661366
}
13671367

1368+
/* The CLUSTERSET should be visible in COMMAND LIST, otherwise the RAMP packer
1369+
* will miss it and a module will not be notified in an enterprise cluster */
13681370
if (!RegisterRedisCommand(rctx, CLUSTER_SET_COMMAND, MR_ClusterSet,
1369-
command_flags, 0, 0, -1)) {
1371+
MR_IsEnterpriseBuild() ? "readonly deny-script _proxy-filtered" : "readonly deny-script",
1372+
0, 0, -1)) {
13701373
return REDISMODULE_ERR;
13711374
}
13721375

tests/mr_test_module/pytests/run_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ else
1919
fi
2020

2121

22-
python3 -m RLTest --verbose-information-on-failure --module $MODULE_PATH --clear-logs "$@" --oss_password "password" --enable-debug-command
22+
python3 -m RLTest --verbose-information-on-failure --no-progress --module $MODULE_PATH --clear-logs "$@" --oss_password "password" --enable-debug-command

tests/mr_test_module/pytests/test_basic.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def testRemoteTaskOnAllShards(env, conn):
8282

8383
@MRTestDecorator(skipOnVersionLowerThan='8.0.0', skipOnCluster=False)
8484
def testInternalCommandsAreNotAllowed(env, conn):
85-
env.expect('MRTESTS.CLUSTERSET').error().contains('unknown command')
8685
env.expect('MRTESTS.INNERCOMMUNICATION').error().contains('unknown command')
8786
env.expect('MRTESTS.HELLO').error().contains('unknown command')
8887
env.expect('MRTESTS.CLUSTERSETFROMSHARD').error().contains('unknown command')

0 commit comments

Comments
 (0)