You are viewing a plain text version of this content. The canonical link for it is here.
Posted to builds@kvrocks.apache.org by GitBox <gi...@apache.org> on 2026/10/16 09:19:48 UTC

[GH] (kvrocks/feat/cluster-failover-takeover): Workflow run "CI" failed!

The GitHub Actions job "CI" on kvrocks.git/feat/cluster-failover-takeover has failed.
Run started by GitHub user Asthenia0412 (triggered by jihuayu).

Head commit for run:
e6ba86d73a9f4f09117accbedfc9a9f951f56185 / Asthenia0412 <As...@users.noreply.github.com>
feat(cluster): implement CLUSTER FAILOVER [FORCE|TAKEOVER]

Add Redis-compatible CLUSTER FAILOVER command for manual master promotion.
Without this, the only recovery path when a master is stuck is to delete
and recreate the cluster via the controller.

Changes:
- src/cluster/cluster.h: add Failover(bool takeover) method declaration
- src/cluster/cluster.cc: implement Failover() with TAKEOVER mode logic
  - Validates current node is a slave in cluster topology
  - Promotes self to master (role=kClusterMaster, clear master_id)
  - Demotes old master to slave (role=kClusterSlave, master_id=self)
  - Increments cluster version (config epoch)
  - Recalculates master count (size_)
  - Reuses existing SetMasterSlaveRepl() for replication switchover
- src/commands/cmd_cluster.cc: add failover subcommand parser and executor
  - CLUSTER FAILOVER (defaults to TAKEOVER)
  - CLUSTER FAILOVER TAKEOVER
  - CLUSTER FAILOVER FORCE (falls back to TAKEOVER for now)
  - Persists cluster nodes info after failover if persistence enabled

Reference: https://github.com/apache/kvrocks/issues/3496

Report URL: https://github.com/apache/kvrocks/actions/runs/38848946646

With regards,
GitHub Actions via GitBox