{"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/da03cdc7e8731092b13e395605c3c1fb2de25de1/redis/commands/cluster.py#L1008-L1044","documentation":"cluster_bumpepoch() unconditionally raises NotImplementedError. The client intentionally does not expose CLUSTER BUMPEPOCH; bumping the cluster config epoch is an internal failover/consensus operation that is unsafe to trigger casually, so the maintainers chose not to implement it. No argument makes it succeed.","triggerScenarios":"Calling r.cluster_bumpepoch() on a RedisCluster client (sync or async). The method body at redis/commands/cluster.py:1025-1028 always raises.","commonSituations":"Seeing the method in autocomplete; following a tutorial that mentions BUMPEPOCH; failover/recovery scripts ported from redis-cli that try to force epoch advancement.","solutions":["Do not call cluster_bumpepoch — it is intentionally not implemented.","If you genuinely need it, run the raw command via r.execute_command('CLUSTER', 'BUMPEPOCH') against a target node, accepting it is an admin-only operation.","Re-evaluate whether you need BUMPEPOCH at all — normal failover handles epoch propagation automatically."],"exampleFix":"# before\nr.cluster_bumpepoch()\n# after (only if you accept the risk)\nr.execute_command('CLUSTER', 'BUMPEPOCH')","handlingStrategy":"validation","validationCode":"# No valid argument exists. Avoid the method entirely:\n# cluster_bumpepoch is intentionally unsupported on the cluster client.\npass  # do not call client.cluster_bumpepoch()","typeGuard":"def supports_cluster_bumpepoch(client) -> bool:\n    return False  # always raises NotImplementedError","tryCatchPattern":"try:\n    client.cluster_bumpepoch()\nexcept NotImplementedError:\n    client.execute_command('CLUSTER', 'BUMPEPOCH')  # only if you accept the risk","preventionTips":["Treat cluster_bumpepoch as unavailable.","Let normal failover manage epochs; do not force them."],"tags":["cluster","unsupported","bumpepoch","notimplemented"],"analyzedSha":"da03cdc7e8731092b13e395605c3c1fb2de25de1","analyzedAt":"2026-08-04T20:26:47.563Z","schemaVersion":2}