Failover Runbook
|
This feature requires an enterprise license. To get a trial license key or extend your trial period, generate a new trial license key. To purchase a license, contact Redpanda Sales. If Redpanda has enterprise features enabled and it cannot find a valid license, restrictions apply. |
This guide provides step-by-step procedures for emergency failover when your primary Redpanda cluster becomes unavailable. Follow these procedures only during active disasters when immediate failover is required.
| If you’re running Redpanda in Kubernetes, see Kubernetes Failover Runbook for Kubernetes-specific emergency procedures. |
|
This is an emergency procedure. For planned failover testing or day-to-day shadow link management, see Failover. Ensure you have completed the disaster readiness checklist before an emergency occurs. |
Emergency failover procedure
Follow these steps during an active disaster:
Assess the situation
Confirm that failover is necessary:
# Check if the primary cluster is responding
rpk cluster info -X brokers=prod-cluster-1.example.com:9092,prod-cluster-2.example.com:9092
# If primary cluster is down, check shadow cluster health
rpk cluster info -X brokers=shadow-cluster-1.example.com:9092,shadow-cluster-2.example.com:9092
Decision point: If the primary cluster is responsive, consider whether failover is actually needed. Partial outages may not require full disaster recovery.
Examples that require full failover:
-
Primary cluster is completely unreachable (network partition, regional outage)
-
Multiple broker failures preventing writes to critical topics
-
Data center failure affecting majority of brokers
-
Persistent authentication or authorization failures across the cluster
Examples that may NOT require failover:
-
Single broker failure with sufficient replicas remaining
-
Temporary network connectivity issues affecting some clients
-
High latency or performance degradation (but cluster still functional)
-
Non-critical topic or partition unavailability
Verify shadow cluster status
Check the health of your shadow links:
# List all shadow links
rpk shadow list
# Check the configuration of your shadow link
rpk shadow describe <shadow-link-name>
# Check the status of your disaster recovery link
rpk shadow status <shadow-link-name>
For detailed command options, see rpk shadow list, rpk shadow describe, and rpk shadow status.
Verify that the following conditions exist before proceeding with failover:
-
Shadow link state should be
ACTIVE. -
Topics should be in
ACTIVEstate (notFAULTED). -
Replication lag should be reasonable for your RPO requirements.
Understanding replication lag
Use rpk shadow status or the Data Plane API to check lag, which shows the message count difference between source and shadow partitions:
-
Acceptable lag examples: 0-1000 messages for low-throughput topics, 0-10000 messages for high-throughput topics
-
Concerning lag examples: Growing lag over 50,000 messages, or lag that continuously increases without recovering
-
Critical lag examples: Lag exceeding your data loss tolerance (for example, if you can only afford to lose 1 minute of data, lag should represent less than 1 minute of typical message volume)
Document current state
Record the current lag and status before proceeding:
# Capture current status for post-mortem analysis
rpk shadow status <shadow-link-name> > failover-status-$(date +%Y%m%d-%H%M%S).log
To keep a machine-readable copy as well, capture the JSON output:
rpk shadow status <shadow-link-name> --format json > failover-status-$(date +%Y%m%d-%H%M%S).json
Capture the status before and during the failover, and again before you delete the shadow link.
The partition information shows the following:
| Field | Description |
|---|---|
SRC_LSO |
Source partition last stable offset |
SRC_HWM |
Source partition high watermark |
DST_HWM |
Shadow (destination) partition high watermark |
Lag |
Message count difference between source and shadow partitions |
|
Note the replication lag to estimate potential data loss during failover. The |
Fence the source cluster if it’s reachable
If the source cluster still answers, fence it before you fail over, so that clients can’t keep writing to it. Exempt the shadow link’s user first, or the fence also stops replication:
# On the source cluster
rpk cluster fencing config update --config-file fencing.yaml
rpk cluster fencing enable --wait
Keep the source cluster fenced after the failover. For the settings file and the full procedure, see Source Cluster Fencing. If the source cluster is unreachable, skip this step.
Initiate failover
A whole-link failover is appropriate if you observe that the source cluster is no longer reachable:
# Fail over the whole shadow link and wait for it to complete
rpk shadow failover <shadow-link-name> --wait
In a script, add --no-confirm, because the confirmation prompt needs a terminal.
The whole-link failover permanently stops the link’s metadata sync tasks, fails over every active and paused shadow topic, and lifts Schema Registry write protection when the link reaches FAILED_OVER. It requires Redpanda 26.3 or later on every broker. On an older cluster, use rpk shadow failover <shadow-link-name> --all instead.
For detailed command options, see rpk shadow failover.
With --wait, the command reports each state and phase change. When the output shows on screen, it updates a single line with a spinner. When you redirect the output to a file or pipe it to another command, it prints one line for each change, for example:
STATE FAILING_OVER, PHASE FINISH_TASKS (1/2) STATE FAILING_OVER, PHASE FAIL_OVER_TOPICS (2/2) STATE FAILED_OVER Shadow Link "<shadow-link-name>" failed over.
The command exits with code 0 only when the link reaches FAILED_OVER. If the failover faults, the command exits with code 1 and prints the fault reason. See Shadow link in FAILOVER_FAULTED state. Pressing Ctrl+C stops only the wait. The failover continues on the cluster.
If rpk refuses because a broker does not answer: During a disaster, a shadow cluster broker might be down. rpk can’t confirm that broker’s version, so it refuses to start a whole-link failover. Start the failover through the Admin API of a broker that is running, which must run 26.3 or later:
curl -X POST http://<broker-address>:9644/redpanda.core.admin.v2.ShadowLinkService/FailOver \
-H 'Content-Type: application/json' \
-d '{"name": "<shadow-link-name>", "failOverLink": true}'
Then monitor the failover with rpk shadow status <shadow-link-name>.
For selective topic failover (when only specific services are affected):
A selective failover, including --all, fails over topic data only. The shadow link stays ACTIVE, its metadata sync tasks keep running, and Schema Registry write protection stays in place. --all refuses if any shadow topic is PAUSED or PROMOTING.
|
# Fail over individual topics
rpk shadow failover <shadow-link-name> --topic <topic-name-1>
rpk shadow failover <shadow-link-name> --topic <topic-name-2>
Monitor failover progress
Track the failover process:
If you started the failover without --wait, or through the Admin API, check its progress with rpk shadow status. During a whole-link failover, the overview shows the STATE, FAILOVER PHASE, PHASE STARTED, and TOPICS rows, and FAULT REASON if the failover faulted. See Monitor failover progress.
Example output while a whole-link failover is in the FINISH_TASKS phase (task rows trimmed, partition tables omitted):
OVERVIEW ======== NAME <shadow-link-name> UID <uid> STATE FAILING_OVER FAILOVER PHASE FINISH_TASKS (1/2) PHASE STARTED 2026-11-10T08:14:04Z TOPICS 4 total, 4 ACTIVE TASKS ===== NAME BROKER-ID SHARD STATE REASON Consumer Group Shadowing 0 0 ACTIVE Consumer Group Shadowing has started Consumer Group Shadowing 1 0 FINISHED terminated by link failover - sync completeness not guaranteed (link failing_over) Source Topic Sync 0 0 FINISHED terminated by link failover - sync completeness not guaranteed (link failing_over) ... TOPICS ====== Name: <topic-name>, State: ACTIVE Name: <topic-name>, State: ACTIVE
# Monitor status until the failover completes
watch -n 5 "rpk shadow status <shadow-link-name>"
# Check detailed topic status and lag during emergency
rpk shadow status <shadow-link-name> --print-topic
Example output during a failover of individual topics (partition tables omitted):
OVERVIEW ======== NAME <shadow-link-name> UID <uid> STATE ACTIVE TOPICS 4 total, 2 ACTIVE, 2 FAILED_OVER TASKS ===== NAME BROKER-ID SHARD STATE REASON Consumer Group Shadowing 0 0 NOT_RUNNING Consumer Group Shadowing 1 0 ACTIVE Consumer Group Shadowing has started Consumer Group Shadowing 2 0 ACTIVE Consumer Group Shadowing has started Roles Migrator Task 0 0 ACTIVE Roles Migrator Task has started Schema Registry Shadowing 0 0 NOT_RUNNING Schema Registry Shadowing 1 0 PAUSED Schema Registry Shadowing has paused Schema Registry Shadowing 2 0 NOT_RUNNING Security Migrator Task 0 0 ACTIVE Security Migrator Task has started Source Topic Sync 0 0 ACTIVE Source Topic Sync has started TOPICS ====== Name: _schemas, State: ACTIVE Name: a, State: FAILED_OVER Name: b, State: FAILED_OVER Name: c, State: ACTIVE
Wait for: After a whole-link failover, the shadow link to reach the FAILED_OVER state. Then confirm the following:
-
Every sync task shows
FINISHED. -
The
TOPICSsummary shows no topic inACTIVE,PAUSED, orFAILING_OVER.FAILED_OVERis the expected end state. Topics that were alreadyFAULTEDorPROMOTEDkeep that state, which doesn’t mean the failover failed. -
Schema Registry writes succeed.
After a failover of individual topics, wait for all critical topics to reach the FAILED_OVER state.
Update application configuration
Redirect your applications to the shadow cluster by updating connection strings in your applications to point to shadow cluster brokers. If using DNS-based service discovery, update DNS records accordingly. Restart applications to pick up new connection settings and verify connectivity from application hosts to shadow cluster.
Verify application functionality
Test critical application workflows:
# Verify applications can produce messages
rpk topic produce <topic-name> -X brokers=<shadow-cluster-address>:9092
# Verify applications can consume messages
rpk topic consume <topic-name> -X brokers=<shadow-cluster-address>:9092 --num 1
Test message production and consumption, consumer group functionality, and critical business workflows to ensure everything is working properly.
Clean up and stabilize
After all applications are running normally:
# Optional: Delete the shadow link (no longer needed)
rpk shadow delete <shadow-link-name>
For detailed command options, see rpk shadow delete.
After a whole-link failover, the link is FAILED_OVER and a plain rpk shadow delete succeeds without --force. Deleting the link removes only the link record, never topics or data, and frees the slot for a new shadow link, for example to shadow in the other direction later.
Document the time of failover initiation and completion, applications affected and recovery times, data loss estimates based on replication lag, and issues encountered during failover.
Troubleshoot common issues
Shadow link in FAILOVER_FAULTED state
Problem: A whole-link failover stopped, and rpk shadow status shows STATE FAILOVER_FAULTED. With --wait, rpk shadow failover exits with code 1 and prints failover faulted: Shadow Link "<shadow-link-name>": <reason>.
Cause: A failover phase did not finish within the shadow_link_failover_timeout deadline (default: 5 minutes). The FAULT REASON row names the phase and what blocked it. Common causes:
-
In
FINISH_TASKS: A shadow cluster broker is down or not responding, so it can’t report that its sync tasks finished. The fault reason readsbrokers <ids> did not report their tasks. -
In
FINISH_TASKS:<n> of <m> task instances not finished. A sync task is still waiting for its last requests to the unreachable source to time out (60 seconds each). The task finishes on its own after they do, even though the source never answers. Run the failover again. Nothing on the source cluster needs fixing, and you don’t need to raiseshadow_link_failover_timeout. -
In
FAIL_OVER_TOPICS: A shadow topic can’t fail over, for example a topic with a replication factor of 1 whose only replica is on a broker that is down. The fault reason names the topics that aren’t in a final state.
Solution:
-
Read the fault reason:
rpk shadow status <shadow-link-name> -
Fix the cause, for example by bringing the broker back. If the fault reason lists task instances that are not finished, there is nothing to fix. Go to the next step.
-
Run the failover again. It resumes from the phase it stopped in, with a new deadline:
rpk shadow failover <shadow-link-name> --wait
You don’t need to raise shadow_link_failover_timeout for a link with many topics. Rerunning the failover gives the phase a new deadline.
If a shadow cluster broker is lost permanently, it stays in the cluster membership until you decommission it, and every new attempt faults again in FINISH_TASKS with brokers <id> did not report their tasks. To finish the failover:
-
Decommission the lost broker with
rpk cluster brokers decommission <broker-id>. After the decommission completes, the broker leaves the cluster membership and the failover stops waiting for it. A link that is stillFAILING_OVERadvances on its own. For a link inFAILOVER_FAULTED, runrpk shadow failover <shadow-link-name>again.The decommission completes only after every replica that the broker held is rebuilt on the remaining brokers. That needs enough brokers for the replication factor, and it can take a long time on a large cluster.
-
If the failover can’t wait for the decommission, contact Redpanda Support. Support can move the failover past the
FINISH_TASKSphase without deleting the shadow link, so the topics still fail over in theFAIL_OVER_TOPICSphase. -
As a last resort, force delete the shadow link. See Topics stuck in FAILING_OVER state.
Topic stuck in FAILING_OVER during a whole-link failover
Problem: During a whole-link failover, a shadow topic stays in FAILING_OVER, and the link stays in the FAIL_OVER_TOPICS phase.
Solution: Wait for the phase deadline. The link then moves to FAILOVER_FAULTED, and the fault reason names the topic. Fix the cause, such as an unavailable partition leader, and run the failover again. If the topic still can’t fail over, contact Redpanda Support. As a last resort, force delete the shadow link.
Topic in FAULTED state after a whole-link failover
Problem: After the link reaches FAILED_OVER, a topic still shows FAULTED and rejects writes.
Cause: The topic was FAULTED before the failover, typically because its source topic was deleted and recreated with the same name. A whole-link failover leaves FAULTED topics unchanged, and they stay read-only.
Solution: The topic needs to be removed from the shadow link or moved forward to FAILED_OVER. Contact Redpanda Support for help.
Commands rejected after a whole-link failover starts
Problem: After a whole-link failover starts, rpk shadow update, rpk shadow failover --topic, and rpk shadow failover --all fail with an error that reports the link configuration as frozen.
Cause: A whole-link failover freezes the link configuration. After it starts, you can’t update the link, add shadow topics, or fail over individual topics. rpk shadow task pause and rpk shadow task resume are also rejected, with a message that a failover has started.
Solution: Let the whole-link failover finish, or resume it with rpk shadow failover <shadow-link-name>. You can still run rpk shadow failover <shadow-link-name> and rpk shadow delete.
Topics stuck in FAILING_OVER state
Problem: Topics remain in FAILING_OVER state for extended periods
For a whole-link failover, see Topic stuck in FAILING_OVER during a whole-link failover first.
Solution: Check shadow cluster logs for specific error messages and ensure sufficient cluster resources (CPU, memory, disk space) are available on the shadow cluster. Verify network connectivity between shadow cluster nodes and confirm that all shadow topic partitions have elected leaders and the controller partition is properly replicated with an active leader.
If topics remain stuck after addressing these cluster health issues and you need immediate failover, you can force delete the shadow link to failover all topics:
# Force delete the shadow link to failover all topics
rpk shadow delete <shadow-link-name> --force
|
Force deleting a shadow link immediately fails over all topics in the link. This action is irreversible and should only be used when topics are stuck and you need immediate access to all replicated data. |
Topics in FAULTED state
Problem: Topics show FAULTED state and are not replicating
Solution:
A shadow topic enters the FAULTED state when its source topic is deleted and then recreated with the same name. Shadowing tracks each source topic by its topic ID, and it marks the shadow topic as faulted when either of the following happens on the source cluster:
-
The topic ID of the source topic changes.
-
The source topic has fewer partitions than the shadow topic.
A faulted shadow topic stops replicating and stays in the FAULTED state until you replace it.
To confirm the cause, check the shadow cluster’s broker logs for a warning that contains has changed its topic ID or has fewer partitions than expected. The warning names the faulted topic.
Deleting a source topic without recreating it does not fault the shadow topic. The shadow topic and the data it already replicated remain on the shadow cluster.
Authentication, permission, and network problems do not fault individual topics. They affect the shadow link’s tasks, which report states such as LINK_UNAVAILABLE.
If you use rpk to update the shadow link in the following steps, use rpk v26.2.2 or later, such as the version that ships with Redpanda 26.3, or rpk v26.1.15 or a later 26.1 version. rpk v26.2.1, and v26.1.14 and earlier, add the filters you edit to the existing filter list instead of replacing the list, so they cannot remove the exclude filter after you delete the topic.
To resume replication from a recreated source topic, replace the faulted shadow topic:
-
Update the shadow link to add an exclude filter that matches the name of each faulted topic exactly (
LITERALpattern type) to the auto-create topic filters. See Update an existing shadow link.Redpanda rejects the deletion of a shadow topic that matches the auto-create topic filters, so add the exclude filter before you delete the topic.
-
Delete each faulted shadow topic on the shadow cluster:
rpk topic delete <topic-name>This deletes the shadow topic and all data it replicated from the original source topic.
-
Update the shadow link again to remove the exclude filters that you added.
On its next topic metadata sync, Shadowing creates a new shadow topic for each recreated source topic.
-
Verify that the topics are replicating:
rpk shadow status <shadow-link-name>The replaced topics show the
ACTIVEstate.
Application connection failures
Problem: Applications cannot connect to shadow cluster after failover
Solution: Verify shadow cluster broker endpoints are correct and check security group and firewall rules. Confirm authentication credentials are valid for the shadow cluster and test network connectivity from application hosts.
Consumer group offset issues
Problem: Consumers start from beginning or wrong positions
Solution: Verify consumer group offsets were replicated (check your filters) and use rpk group describe <group-name> to check offset positions. If necessary, manually reset offsets to appropriate positions. See How to manage consumer group offsets in Redpanda for detailed reset procedures.
Next steps
After successful failover, focus on recovery planning and process improvement. Begin by assessing the source cluster failure and determining whether to restore the original cluster or permanently promote the shadow cluster as your new primary.
Immediate recovery planning:
-
Assess source cluster: Determine root cause of the outage
-
Plan recovery: Decide whether to restore source cluster or promote shadow cluster permanently
-
Data synchronization: Plan how to synchronize any data produced during failover
-
Fail forward: Create a new shadow link with the failed over shadow cluster as source to maintain a DR cluster
Process improvement:
-
Document the incident: Record timeline, impact, and lessons learned
-
Update runbooks: Improve procedures based on what you learned
-
Test regularly: Schedule regular disaster recovery drills
-
Review monitoring: Ensure monitoring caught the issue appropriately