Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

REPLICATION.FAILOVER

Last updated
REPLICATION.FAILOVER
Group
Replication
Complexity
O(1)
Arity
1 (exactly, counting the command name)
Flags
admin, slow
HotKV Cloud
Scale
On-Premise
requires the replication license feature

REPLICATION.FAILOVER promotes the receiving replica to primary: it stops following its primary, keeps the data it has, starts accepting writes, and accepts replicas of its own. Use it when the primary of a non-cluster deployment is lost or being retired. Point your clients, and any other replicas, at the new primary afterwards.

Writes the old primary accepted but had not yet sent to this replica are not on the new primary, so if the old primary is still up, stop writes to it (or let the replica catch up) first. In cluster mode, use CLUSTER FAILOVER instead.

Simple string OK in RESP2 and RESP3, or one of these errors:

Case Error
Cluster mode is on ERR In cluster mode use CLUSTER FAILOVER
The node is not a replica ERR This node is not a replica
The node could not start as primary ERR Replication could not start as primary, see the server log
No license that includes replication NOLICENSE replication requires a HotKV license. Contact sales@hotkv.com
127.0.0.1:6380> REPLICATION.FAILOVER
OK
127.0.0.1:6379> REPLICATION.FAILOVER
(error) ERR This node is not a replica

HotKV-only command. The Redis FAILOVER command is accepted by HotKV only for compatibility and replies with an error; REPLICAOF NO ONE also promotes a replica.

REPLICATION.INFO, CLUSTER FAILOVER, REPLICAOF, FAILOVER