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 theFAILED_OVERstate. The failover advances through phases, and each phase has its own deadline, set by the cluster propertyshadow_link_failover_timeout; progress inside a phase does not extend that deadline. A phase that misses it leaves the link in theFAILOVER_FAULTEDstate, holding the phase it stopped in, and running the command again resumes from that phase.rpk shadow statusreports 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--allthere 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. |
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 |
|---|---|---|
|
bool |
Fail over every active shadow topic one by one, leaving the link and its metadata sync tasks running. |
|
bool |
Disable confirmation prompt. |
|
string |
Fail over a single shadow topic, leaving the rest of the link replicating; with neither this flag nor |
|
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 |
|---|---|---|
|
string |
Redpanda or |
|
stringArray |
Override |
|
bool |
Ignore |
|
string |
|
|
bool |
Enable verbose logging. |