> For the complete documentation index, see [llms.txt](https://docs.tibero.com/en-owldb-cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tibero.com/en-owldb-cloud/references/dr.md). Agents can also search and read this documentation through its [MCP server](https://docs.tibero.com/en-owldb-cloud/~gitbook/mcp).

# Disaster Recovery (DR)

OwlDB continuously monitors the status of the Primary database configured with DR (or HA) to detect failures and automatically perform failover. This page describes the automatic failover behavior and the policies by automation level.

{% hint style="info" %}
**Note**

In this document, Tibero's **Primary / Standby** corresponds to OpenSQL's **Leader / Replica**. Items that apply commonly are written together as `Primary/Leader` and `Standby/Replica`.
{% endhint %}

## Failure Detection <a href="#failure-detection" id="failure-detection"></a>

**Tibero**

The system performs a health check every second, and if the Primary (Tibero) DB remains in the `Unavailable` state for 30 seconds, failover is performed automatically. In a Tibero TAC configuration, a failure is determined when all Primary nodes are in the `Unavailable` state.

**OpenSQL**

Leader failure determination and Replica promotion are performed by patroni. patroni's automatic promotion operates only when the failover automation level is **Level 3**, and at Level 0 it does not promote automatically. OwlDB checks every 10 seconds whether the Leader has changed and reflects it.

## Step-by-Step Notification Policy <a href="#notification-policy-by-level" id="notification-policy-by-level"></a>

| Role            | Standby/Replica promotion                                                       | Configuration normalization                                            |
| --------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| Execution Point | Immediately after failure detection                                             | After Standby/Replica promotion                                        |
| Notification    | <ul><li>Start</li><li>Request Failed</li><li>Completed</li><li>Failed</li></ul> | <ul><li>Completed</li><li>Failed</li></ul>                             |
| Switch History  | Success / failure indicated in the Result column                                | Failure cause indicated in the Cause/Remarks column (blank on success) |

## Switchover History Recording <a href="#failover-history" id="failover-history"></a>

When failover completes, it is recorded in the switchover history as follows depending on the situation.

| Situation                                                     | Result  | Cause/Details                                   |
| ------------------------------------------------------------- | ------- | ----------------------------------------------- |
| Both promotion and configuration normalization succeeded      | Success | (blank)                                         |
| Promotion failed                                              | Failed  | `Standby promotion Failed`                      |
| Configuration normalization failed after successful promotion | Success | `Cluster Normalization Failed: {Failure cause}` |
| OpenSQL failed to reconnect to the existing Leader            | Failed  | Failure reason                                  |

This is the item displayed in `{failure cause}`. If there are multiple causes, they are separated by commas.

| Failure cause                 | Time of occurrence                                 |
| ----------------------------- | -------------------------------------------------- |
| `Primary scale-out failed`    | new Primary Scale-Out failure in TAC configuration |
| `New standby creation failed` | New Standby creation failure in steps 2 and 3      |

## Summary of Failover Automation by Step <a href="#automation-level-summary" id="automation-level-summary"></a>

| Automation Level                              | Automatic Failover | Automatic Configuration Normalization                                                                                                                                                                                         | Remarks                                                                                                          |
| --------------------------------------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| Step 0 (**Manual**)                           | ❌                  | ❌                                                                                                                                                                                                                             | The user directly performs promotion and normalization using the `Role Switch` button                            |
| Step 1 (**Automatic Failover**)               | ✓                  | <ul><li>Only the node count is recovered via TAC Scale-Out</li><li>New Standby not created → <code>Degraded</code> if no Standby remains</li></ul>                                                                            | Old Primary is processed as `retired`                                                                            |
| Step 2 (**Automatic Configuration Recovery**) | ✓                  | <ul><li>TAC Scale-Out</li><li>Automatic creation and synchronization of a new Standby</li></ul>                                                                                                                               | Old Primary is processed as `retired`                                                                            |
| Step 3 (**Full Automation**)                  | ✓                  | <p><strong>Tibero</strong></p><ul><li>TAC Scale-Out</li><li>Automatic creation and synchronization of a new Standby</li></ul><p><strong>OpenSQL</strong></p><ul><li>Reverse-synchronize the Old Leader as a Replica</li></ul> | <ul><li>Tibero: Old Primary Scale-In (deletion)</li><li>OpenSQL: Reconnect the Old Leader as a Replica</li></ul> |

{% hint style="info" %}
**Note**

If the existing Primary cluster is TAC, Scale-Out is performed to recover the configuration, so the new Primary cluster is also recovered to a TAC configuration. (Applies to Tibero TAC)
{% endhint %}

{% hint style="warning" %}
**Caution**

* In the case of levels 1 and 2, if the Primary/Leader Cluster terminates abnormally, there may be logs that were not transmitted to the Standby/Replica. Because data consistency cannot be guaranteed and to prevent the Split-Brain phenomenon, the instance is marked as **retired**.
* When the failover automation level is **Step 1** and there is only one Standby, that Standby is promoted to Primary, so there may be no Standby after failover. In this case, the high-availability configuration is not maintained, so caution is required. (Applies to Tibero)
  {% endhint %}

## Automation Scope by License Type <a href="#automation-scope-by-license" id="automation-scope-by-license"></a>

In a Cloud environment, the automation level provided differs depending on the DB engine (Tibero/OpenSQL) and the license type (LI/BYOL).

| Automation Level                              | Tibero LI | Tibero BYOL | OpenSQL LI / BYOL |
| --------------------------------------------- | --------- | ----------- | ----------------- |
| Step 0 (**Manual**)                           | ✓         | ✓           | ✓                 |
| Step 1 (**Automatic Failover**)               | ✓         | —           | —                 |
| Step 2 (**Automatic Configuration Recovery**) | ✓         | ✓           | —                 |
| Step 3 (**Full Automation**)                  | ✓         | ✓           | ✓                 |

## Detailed Scenarios by Automation Step <a href="#automation-scenarios" id="automation-scenarios"></a>

{% hint style="info" %}
**Note**

**Topology Status Determination Criteria**

The configuration normalization status after promotion is determined based on whether the configuration has the same shape as the topology method.

* **Tibero TAC configuration**: Checks whether the TAC structure is maintained by performing Scale-Out even after Failover.
  * When there are 2 or more Primary Nodes: `Running`
  * When there are fewer than 2 Primary Nodes: `Degraded`
* **DR / HA configuration (Tibero DR · OpenSQL HA)**: Checks whether a Standby/Replica is held.
  * When there is 1 or more Standby/Replica: `Running` (however, if the Standby/Replica is in an abnormal state, it may be `Degraded`)
  * If there are 0 Standby/Replica: `Degraded`
    {% endhint %}

### Level 0: Manual <a href="#id-0" id="id-0"></a>

**Apply** : Tibero LI · BYOL, OpenSQL LI · BYOL

No automatic action is performed, and when a failure occurs, the user directly promotes the Standby/Replica to Primary/Leader using the `Role Switch` button. The configuration normalization after promotion is also performed manually by the user.

### Level 1: Automatic Failover <a href="#id-1" id="id-1"></a>

**Apply**: Tibero LI (Tibero BYOL · OpenSQL not provided)

A new Standby is not created.

| Level                                 | Key Operations                                                                                        | Status                 | System Notification                                                                                                                                  |
| ------------------------------------- | ----------------------------------------------------------------------------------------------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1. Failure Detection                  | Auto Failover request sent                                                                            | `Failover`             | <ul><li><strong>Auto Failover In Progress</strong></li><li>On request failure, "<strong>Auto Failover Request Failed</strong>"</li></ul>             |
| 2. Attempt to restart the Old Primary | Attempt to restart the existing Primary's VM and DB together                                          | -                      | On successful restart, terminates after an "**Auto Failover Completed**" notification (no promotion)                                                 |
| 3. Standby promotion                  | Promote the Standby that reflects the most recent log (TSN) to Primary                                | `Updating`             | <ul><li>new Primary DB available → "<strong>Auto Failover Completed</strong>"</li><li>On failure, "<strong>Auto Failover Failed</strong>"</li></ul>  |
| 4. Change new Primary configuration   | Perform Scale-Out in case of TAC configuration                                                        | `Updating`             |                                                                                                                                                      |
| 5. Process Old Primary                | Displayed in Retired state, and the instance is terminated after reclaiming the license (not deleted) | -                      |                                                                                                                                                      |
| 6. Completed                          | Configuration Stabilization Completed                                                                 | `Running` / `Degraded` | <ul><li>"<strong>Configuration Stabilization Completed</strong>"</li><li>On failure, "<strong>Configuration Stabilization Failed</strong>"</li></ul> |

### Level 2: Automatic Configuration Recovery <a href="#id-2" id="id-2"></a>

**Apply**: Tibero LI · BYOL (OpenSQL not provided)

Automatically creates a new Standby to restore the high-availability configuration.

| Level                                     | Key Operations                                                                                        | Status                 | System Notification                                                                                                                                  |
| ----------------------------------------- | ----------------------------------------------------------------------------------------------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1. Failure Detection                      | Auto Failover request sent                                                                            | `Failover`             | <ul><li><strong>Auto Failover In Progress</strong></li><li>On request failure, "<strong>Auto Failover Request Failed</strong>"</li></ul>             |
| 2. Attempt to restart the Old Primary     | Attempt to restart the existing Primary's VM and DB together                                          | -                      | On successful restart, terminates after an "**Auto Failover Completed**" notification (no promotion)                                                 |
| 3. Standby promotion                      | Promote the Standby that reflects the most recent log (TSN) to Primary                                | `Updating`             | <ul><li>new Primary DB available → "<strong>Auto Failover Completed</strong>"</li><li>On failure, "<strong>Auto Failover Failed</strong>"</li></ul>  |
| 4. Change new Primary configuration       | Perform Scale-Out in case of TAC configuration (including license transfer)                           | `Updating`             |                                                                                                                                                      |
| 5. Process Old Primary                    | Displayed in Retired state, and the instance is terminated after reclaiming the license (not deleted) | -                      |                                                                                                                                                      |
| 6. Create new Standby                     | Created with the same specifications in the AZ where the Old Primary is located                       | -                      |                                                                                                                                                      |
| 7. Standby connection and synchronization | Standby connection and synchronization                                                                | -                      |                                                                                                                                                      |
| 8. Completed                              | Configuration Stabilization Completed                                                                 | `Running` / `Degraded` | <ul><li>"<strong>Configuration Stabilization Completed</strong>"</li><li>On failure, "<strong>Configuration Stabilization Failed</strong>"</li></ul> |

### Level 3: Full Automation <a href="#id-3" id="id-3"></a>

**Apply** : Tibero LI · BYOL, OpenSQL LI · BYOL

Everything from failover to restoring the existing topology, deleting Tibero's existing Primary and creating a new Standby, and reconnecting OpenSQL's existing Leader is handled automatically.

**Tibero**

| Level                                     | Key Operations                                                                  | Status                 | System Notification                                                                                                                                  |
| ----------------------------------------- | ------------------------------------------------------------------------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1. Failure Detection                      | Auto Failover request sent                                                      | `Failover`             | <ul><li><strong>Auto Failover In Progress</strong></li><li>On request failure, "<strong>Auto Failover Request Failed</strong>"</li></ul>             |
| 2. Attempt to restart the Old Primary     | Attempt to restart the existing Primary's VM and DB together                    | -                      | On successful restart, terminates after an "**Auto Failover Completed**" notification (no promotion)                                                 |
| 3. Standby promotion                      | Promote the Standby that reflects the most recent log (TSN) to Primary          | `Updating`             | <ul><li>new Primary DB available → "<strong>Auto Failover Completed</strong>"</li><li>On failure, "<strong>Auto Failover Failed</strong>"</li></ul>  |
| 4. Change new Primary configuration       | Perform Scale-Out in case of TAC configuration                                  | `Updating`             |                                                                                                                                                      |
| 5. Delete Old Primary                     | Scale-In the Old Primary to delete it                                           | -                      |                                                                                                                                                      |
| 6. Create new Standby                     | Created with the same specifications in the AZ where the Old Primary is located | -                      |                                                                                                                                                      |
| 7. Standby connection and synchronization | Standby connection and synchronization                                          | -                      |                                                                                                                                                      |
| 8. Completed                              | Configuration Stabilization Completed                                           | `Running` / `Degraded` | <ul><li>"<strong>Configuration Stabilization Completed</strong>"</li><li>On failure, "<strong>Configuration Stabilization Failed</strong>"</li></ul> |

**OpenSQL**

| Level                                  | Key Operations                                                                                   | Status                 | System Notification                                                                                                                                  |
| -------------------------------------- | ------------------------------------------------------------------------------------------------ | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1. Failure Detection                   | Patroni detects the Leader failure and promotes a Replica to the new Leader                      |                        |                                                                                                                                                      |
| 2. Detecting Failover execution        | OwlDB detects that the Leader has changed and reflects the new Leader                            | `Failover`             | **Auto Failover In Progress**                                                                                                                        |
| 3. Resynchronizing the existing Leader | Restart the existing Leader to reconnect it as a Replica (if it fails, resynchronize via reinit) | `Failover`             |                                                                                                                                                      |
| 4. Complete                            | Configuration Stabilization Completed                                                            | `Running` / `Degraded` | <ul><li>"<strong>Configuration Stabilization Completed</strong>"</li><li>On failure, "<strong>Configuration Stabilization Failed</strong>"</li></ul> |
