{"record":{"id":"be428b063b84fa7f","repo":"redis/redis-py","slug":"failover-is-intentionally-not-implemented-in-the-c","errorCode":null,"errorMessage":"FAILOVER is intentionally not implemented in the client.","messagePattern":"FAILOVER is intentionally not implemented in the client\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"redis/commands/core.py","lineNumber":2301,"sourceCode":"        return self.execute_command(\n            \"WAITAOF\", num_local, num_replicas, timeout, **kwargs\n        )\n\n    def hello(self):\n        \"\"\"\n        This function throws a NotImplementedError since it is intentionally\n        not supported.\n        \"\"\"\n        raise NotImplementedError(\n            \"HELLO is intentionally not implemented in the client.\"\n        )\n\n    def failover(self):\n        \"\"\"\n        This function throws a NotImplementedError since it is intentionally\n        not supported.\n        \"\"\"\n        raise NotImplementedError(\n            \"FAILOVER is intentionally not implemented in the client.\"\n        )\n\n    @overload\n    def hotkeys_start(\n        self: SyncClientProtocol,\n        metrics: List[HotkeysMetricsTypes],\n        count: int | None = None,\n        duration: int | None = None,\n        sample_ratio: int | None = None,\n        slots: List[int] | None = None,\n        **kwargs,\n    ) -> bytes | str: ...\n\n    @overload\n    def hotkeys_start(\n        self: AsyncClientProtocol,\n        metrics: List[HotkeysMetricsTypes],","sourceCodeStart":2283,"sourceCodeEnd":2319,"githubUrl":"https://github.com/redis/redis-py/blob/6a6b581b48225afa0b76912d1028c6035baee932/redis/commands/core.py#L2283-L2319","documentation":"Raised by failover() (redis/commands/core.py:2301) which is a stub that unconditionally raises NotImplementedError. FAILOVER initiates a replication failover to a replica and is a long-blocking, topology-altering operation better orchestrated by sentinel/cluster tooling than a generic client method, so the library refuses it. No arguments are accepted.","triggerScenarios":"Calling r.failover(). Any call raises immediately.","commonSituations":"Manually promoting a replica from application code; assuming the client mirrors every admin command.","solutions":["Use redis.Sentinel for managed failover, or redis.RedisCluster for cluster topology","If you must trigger it directly: r.execute_command(\"FAILOVER\", *opts) with explicit TIMEOUT/FORCE/TO as needed","Prefer orchestrating failover at the infrastructure/sentinel layer rather than from app code"],"exampleFix":"# before\nr.failover()\n# after\nr.execute_command(\"FAILOVER\")  # if a manual failover is truly required","handlingStrategy":"fallback","validationCode":"# failover() is intentionally unimplemented; use execute_command or sentinel\ndef manual_failover(r, **opts):\n    pieces = []\n    for k, v in opts.items():\n        pieces.extend([k.upper(), v])\n    return r.execute_command(\"FAILOVER\", *pieces)","typeGuard":null,"tryCatchPattern":"try:\n    r.failover()\nexcept NotImplementedError:\n    r.execute_command(\"FAILOVER\")","preventionTips":["Prefer Sentinel/Cluster orchestration for failover over app-level calls.","If manual failover is required, wrap execute_command('FAILOVER',...).","Document that the client method is a permanent stub."],"tags":["replication","notimplemented","intentional","failover"],"backgroundTag":null,"analyzedSha":"6a6b581b48225afa0b76912d1028c6035baee932","analyzedAt":"2026-08-10T12:52:44.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}