> For the complete documentation index, see [llms.txt](https://docs.vega365.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vega365.com/tandem/recovering-from-recorder-failure/failback.md).

# Failback

How a cluster returns to its configured roles after the primary recovers, and how the primary then recovers the video it missed.

## Failback

Failback returns a cluster to its configured roles after a failover: the primary becomes the attached member again, and the secondary returns to headless standby.

Failback is automatic. When the failed primary returns, it takes back the attached role, and backfill restores the missed video. No administrator or operator action is needed.

{% hint style="info" %}
**Failback only follows a failover.** If the secondary fails, the primary stays attached throughout, and there is nothing to fail back. In this case, after the secondary is restored, it backfills missing content. Backfill is bi-directional.
{% endhint %}

### 1. Failed over

While the primary is down, the secondary is attached and serving clients. The Clustering **Dashboard** shows the cluster as **Failed over**, with the roles swapped: the primary shows **Standby**, the secondary **Active**.

<figure><img src="https://92057524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi0mCLda4cGtI3Jwb6IQA%2Fuploads%2FEmvbDdLboMjAH3wT2hfE%2FFailover_dashboard.png?alt=media&amp;token=267b0273-6022-4550-8be5-94ab6381df4f" alt=""><figcaption><p>Failed over — the secondary is active</p></figcaption></figure>

### 2. The primary returns&#x20;

When the primary comes back online, it rejoins the cluster, resumes recording all cameras, and resumes its attached role. It resumes serving clients straight away. The secondary detaches and returns to standby, still recording every camera.

<figure><img src="https://92057524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi0mCLda4cGtI3Jwb6IQA%2Fuploads%2F0DRZJdI6uCcuvXpJNyEH%2Fafter_failback.png?alt=media&amp;token=bf0d78d5-e0ca-4c81-bbc7-e6bfba2376f0" alt=""><figcaption><p>The primary is active again</p></figcaption></figure>

At this point, the cluster is back in its configured roles — but the primary's recordings are not yet complete. It has a gap for the period it was down.

{% hint style="info" %}
**"In sync" on the Clustering Dashboard refers to configuration, not recordings.** The cluster can show In sync while backfill is still running. To see whether the recordings have caught up, use the BackFill Flow Dashboard.
{% endhint %}

### 3. Backfill restores what the primary missed

Backfill now copies the missing period from the secondary, which is recording throughout. The transfer runs as described in [Recovering from Recorder Failure](https://docs.vega365.com/tandem/recovering-from-recorder-failure.md).

Backfill can take a while. How long depends on:

* **The amount of content** — the length of the outage, at the recorded bitrate of the cameras.
* **Bandwidth throttling** — the limits in the primary's throttling table for the hours the job runs in. [Backfill Configuration](https://docs.vega365.com/tandem/configuration/on-the-management-client/backfill-configuration.md)
* **The live recording folder at the source** — the most recent folder on the secondary must fill and close before it can be copied. This usually takes about an hour, and can take several hours when cameras record on motion only, and there is little motion.

Everything that governs backfill applies to the primary here — its staging drive needs spare capacity for the outage, and its throttling table sets the rate. See [Backfill Configuration](https://docs.vega365.com/tandem/configuration/on-the-management-client/backfill-configuration.md).

{% hint style="warning" %}
**Playback of the outage period is unavailable until backfill completes.** The primary is serving clients, and it does not yet hold the video from the period it was down. That video is safe on the secondary, but the secondary does not serve clients. An operator who plays back that period before backfill finishes sees a gap; once backfill completes, the same period plays back in full.

Recording since the primary returned, and everything before the outage, is available throughout.
{% endhint %}

<figure><img src="https://92057524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi0mCLda4cGtI3Jwb6IQA%2Fuploads%2FQVd31o2k4FhuCWCQXMHq%2Fbackfill_in_progress.png?alt=media&amp;token=8fcce62f-74d0-4761-be81-9b3d4457b4de" alt=""><figcaption><p>Backfill in progress</p></figcaption></figure>

### 4. Back in sync

When backfill completes, both members again hold the same recordings, and the outage period plays back normally from the primary.

The BackFill **Flow Dashboard** shows both members online, and the primary's **Backfill History** shows the completed job.

<figure><img src="https://92057524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi0mCLda4cGtI3Jwb6IQA%2Fuploads%2FEL455gsQ3dYMzOWFQC18%2Fbf_log.png?alt=media&amp;token=b9960aae-2c6d-4aed-9aa5-2fbf48313b35" alt=""><figcaption><p>Backfill Log History</p></figcaption></figure>

### What operators experience

Failback changes which member is serving clients, so Smart Client goes through the same brief reconnect it does during a failover: live video pauses while the client reconnects, then resumes, with views and layouts unchanged. See the [Smart Client](https://docs.vega365.com/tandem/recovering-from-recorder-failure/smart-client.md).

Recording is not affected. Both members are recording every camera throughout, so the moment the attached role changes leaves no gap on the timeline.

Operators may notice a temporary playback gap for the outage period, described above, until backfill completes.

### What the administrator does

Nothing is required. To confirm a failback has fully completed:

* The Clustering Dashboard shows the primary **Active** and the secondary **Standby**.
* The BackFill Flow Dashboard shows both members online, rather than syncing.
* The primary's **Backfill History** on the BackFill Configuration tab shows a job with the secondary as the source server, covering the period the primary was down.

The first confirms the roles are restored. The second and third confirm the recordings are.
