Skip to content

[NEW] Add module API for querying slot ranges by node ID #14951

Closed

Description

@jjz921024

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);

Activity

  1. changed the title [-][NEW] Add API for querying slot ranges by node ID[/-] [+][NEW] Add module API for querying slot ranges by node ID[/+] on Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions