The problem/use-case that the feature addresses
The Module API currently provides RedisModule_ClusterGetLocalSlotRanges() to retrieve the slot ranges owned by the local node. However, there is no corresponding API to query slot ranges of an arbitrary node in the cluster by its node ID.
Description of the feature
In some module use cases, a module running on one node may need to know which slots are owned by another node. Currently the only way to achieve this is through RM_Call with the CLUSTER SLOTS or CLUSTER NODES command, which is inefficient and requires parsing the raw output. A dedicated C API would provide a cleaner, lower-overhead alternative.
Proposed API
RedisModuleSlotRangeArray *RedisModule_ClusterGetSlotRangesByNodeId(RedisModuleCtx *ctx, const char *nodeid);
The problem/use-case that the feature addresses
The Module API currently provides
RedisModule_ClusterGetLocalSlotRanges()to retrieve the slot ranges owned by the local node. However, there is no corresponding API to query slot ranges of an arbitrary node in the cluster by its node ID.Description of the feature
In some module use cases, a module running on one node may need to know which slots are owned by another node. Currently the only way to achieve this is through RM_Call with the CLUSTER SLOTS or CLUSTER NODES command, which is inefficient and requires parsing the raw output. A dedicated C API would provide a cleaner, lower-overhead alternative.
Proposed API