{"record":{"id":"4a266e2e80dc8f39","repo":"redis/redis-py","slug":"cluster-bumpepoch-is-intentionally-not-implemented","errorCode":null,"errorMessage":"CLUSTER BUMPEPOCH is intentionally not implemented in the client.","messagePattern":"CLUSTER BUMPEPOCH is intentionally not implemented in the client\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"redis/commands/cluster.py","lineNumber":1026,"sourceCode":"    ) -> ClusterLinksResponse | Awaitable[ClusterLinksResponse]:\n        \"\"\"\n        Each node in a Redis Cluster maintains a pair of long-lived TCP link with each\n        peer in the cluster: One for sending outbound messages towards the peer and one\n        for receiving inbound messages from the peer.\n\n        This command outputs information of all such peer links as an array.\n\n        For more information see https://redis.io/commands/cluster-links\n        \"\"\"\n        return self.execute_command(\"CLUSTER LINKS\", target_nodes=target_node)\n\n    def cluster_flushslots(self, target_nodes: \"TargetNodesT\" | None = None) -> None:\n        raise NotImplementedError(\n            \"CLUSTER FLUSHSLOTS is intentionally not implemented in the client.\"\n        )\n\n    def cluster_bumpepoch(self, target_nodes: \"TargetNodesT\" | None = None) -> None:\n        raise NotImplementedError(\n            \"CLUSTER BUMPEPOCH is intentionally not implemented in the client.\"\n        )\n\n    def readonly(self, target_nodes: \"TargetNodesT\" | None = None) -> ResponseT:\n        \"\"\"\n        Enables read queries.\n        The command will be sent to the default cluster node if target_nodes is\n        not specified.\n\n        For more information see https://redis.io/commands/readonly\n        \"\"\"\n        if target_nodes == \"replicas\" or target_nodes == \"all\":\n            # read_from_replicas will only be enabled if the READONLY command\n            # is sent to all replicas\n            self.read_from_replicas = True\n        return self.execute_command(\"READONLY\", target_nodes=target_nodes)\n\n    def readwrite(self, target_nodes: \"TargetNodesT\" | None = None) -> ResponseT:","sourceCodeStart":1008,"sourceCodeEnd":1044,"githubUrl":"https://github.com/redis/redis-py/blob/6a6b581b48225afa0b76912d1028c6035baee932/redis/commands/cluster.py#L1008-L1044","documentation":"RedisCluster.cluster_bumpepoch() is a stub that always raises NotImplementedError. CLUSTER BUMPEPOCH is a low-level cluster internals command; the client deliberately omits it because epoch bumps are driven by the cluster's own failover/replication protocol and should not be triggered by application code.","triggerScenarios":"Calling client.cluster_bumpepoch() on a RedisCluster or redis.asyncio.RedisCluster instance with any arguments. Raises unconditionally regardless of target_nodes.","commonSituations":"Exploratory scripting against cluster internals; copying a redis-cli recipe into Python; trying to force epoch advancement during manual cluster repair.","solutions":["Do not call cluster_bumpepoch() from this client.","Run `CLUSTER BUMPEPOCH` via redis-cli directly on the target node if you have a confirmed need.","For epoch/failover problems, investigate cluster state with cluster_info()/cluster_nodes() instead of forcing epoch changes."],"exampleFix":"# before\nclient.cluster_bumpepoch()\n# after - use redis-cli on the node if truly required\n# redis-cli -h <node> -p <port> CLUSTER BUMPEPOCH","handlingStrategy":"type-guard","validationCode":"def safe_cluster_bumpepoch(client):\n    if type(client).__name__ in ('RedisCluster', 'AsyncRedisCluster'):\n        raise NotImplementedError('cluster_bumpepoch is not supported on the cluster client')\n    return client.cluster_bumpepoch()","typeGuard":"from redis.cluster import RedisCluster\nfrom redis.asyncio.cluster import RedisCluster as AsyncRedisCluster\n\ndef is_cluster_client(client) -> bool:\n    return isinstance(client, (RedisCluster, AsyncRedisCluster))","tryCatchPattern":"try:\n    client.cluster_bumpepoch()\nexcept NotImplementedError:\n    # use redis-cli directly on the node if truly required\n    pass","preventionTips":["Treat cluster_bumpepoch as unavailable from Python.","Prefer cluster_info()/cluster_nodes() for diagnosing cluster state.","Keep cluster-admin operations out of application request paths."],"tags":["redis-cluster","not-implemented","cluster-bumpepoch","intentional-stub"],"backgroundTag":null,"analyzedSha":"6a6b581b48225afa0b76912d1028c6035baee932","analyzedAt":"2026-08-10T12:52:44.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}