Cloud

rpk shadow failover

Fail over a Redpanda Shadow Link.

This command performs a failover operation for a Shadow Link. Failover converts shadow topics into regular topics on the shadow cluster, allowing producers and consumers to interact with them directly. A shadow topic stops replicating data from the source cluster after it is failed over; whether the rest of the link keeps replicating depends on the scope you choose.

The command supports three failover scopes:

  • Without a scope flag, it fails over the whole Shadow Link. Besides failing over its topics, the link permanently stops its metadata sync tasks (topic, consumer group, security, role and Schema Registry sync), freezes its configuration, and lifts Schema Registry write protection after it reaches the FAILED_OVER state. The failover advances through phases, and each phase has its own deadline, set by the cluster property shadow_link_failover_timeout; progress inside a phase does not extend that deadline. A phase that misses it leaves the link in the FAILOVER_FAULTED state, holding the phase it stopped in, and running the command again resumes from that phase. rpk shadow status reports the link state, and outside Redpanda Cloud the phase the failover is working through. Whole-link failover requires Redpanda 26.3 or later on every broker. On an older cluster, or while an upgrade to 26.3 is in progress, the command refuses before failing over anything; use --all there instead. The command also refuses when a broker does not answer the Admin API, because it cannot confirm that broker’s version; retry after the broker versions can be read again.

  • With --all, it fails over every active shadow topic one by one. The link and its metadata sync tasks keep running.

  • With --topic, it fails over a single shadow topic. The rest of the link keeps replicating.

By default the command returns as soon as the failover is requested. Use --wait to block until the whole-link failover reaches FAILED_OVER, showing each phase as it starts; the command exits non-zero if the failover faults. Ctrl+C stops waiting only: the failover continues on the cluster. --wait is not available for Redpanda Cloud; check the link state with rpk shadow status instead.

The command prompts you to confirm the failover operation. Use the --no-confirm flag to skip the confirmation prompt.

Failover is a critical operation. A shadow topic that is failed over becomes a regular topic and stops replicating from the source cluster. Ensure your applications are ready to connect to the shadow cluster before performing a failover.

Usage

rpk shadow failover <link_name> [flags]

Examples

This section provides examples of how to use rpk shadow failover.

Fail over the whole shadow link. Requires Redpanda 26.3 or later on every broker. Not supported in Redpanda Cloud.

rpk shadow failover my-shadow-link

Fail over the whole shadow link and wait until it reaches FAILED_OVER. Not supported in Redpanda Cloud.

rpk shadow failover my-shadow-link --wait

Fail over the whole shadow link from a script, without a confirmation prompt. Not supported in Redpanda Cloud.

rpk shadow failover my-shadow-link --wait --no-confirm

Fail over every active topic one by one, leaving the shadow link and its sync tasks running.

rpk shadow failover my-shadow-link --all

Fail over a specific topic.

rpk shadow failover my-shadow-link --topic my-topic

Fail over every active topic without confirmation.

rpk shadow failover my-shadow-link --all --no-confirm

Flags

Value Type Description

--all

bool

Fail over every active shadow topic one by one, leaving the link and its metadata sync tasks running.

--no-confirm

bool

Disable confirmation prompt.

--topic

string

Fail over a single shadow topic, leaving the rest of the link replicating; with neither this flag nor --all the whole link is failed over.

-w, --wait

bool

Wait until the link failover completes, showing each phase as it starts; only for a whole-link failover. (New in v26.3.1)

Global flags

Value Type Description

--config

string

Redpanda or rpk config file; default search paths are ~/.config/rpk/rpk.yaml, $PWD/redpanda.yaml, and /etc/redpanda/redpanda.yaml.

-X, --config-opt

stringArray

Override rpk configuration settings; -X help for detail or -X list for terser detail.

--ignore-profile

bool

Ignore rpk.yaml and redpanda.yaml; use default settings.

--profile

string

rpk profile to use.

-v, --verbose

bool

Enable verbose logging.