Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serverless BR #19679

Merged
merged 9 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 88 additions & 31 deletions tidb-cloud/backup-and-restore-serverless.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,83 @@ This document describes how to back up and restore your TiDB Cloud Serverless cl
>
> To learn how to back up and restore TiDB Cloud Dedicated cluster data, see [Back Up and Restore TiDB Cloud Dedicated Data](/tidb-cloud/backup-and-restore.md).

## Limitations
## Automatic Backups
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved

- It is important to note that TiDB Cloud Serverless clusters only support in-place restoring from backups. When a restore is performed, tables in the `mysql` schema are also impacted. Hence, any changes made to user credentials and permissions or system variables will be rolled back to the state when the backup was taken.
- Manual backup is not yet supported.
- The cluster will be unavailable during the restore process, and existing connections will be terminated. You can establish new connections once the restore is complete.
- If any TiFlash replica is enabled, the replica will be unavailable for a while after the restore because data needs to be rebuilt in TiFlash.
Automatic backups will back up your cluster data automatically, and you can restore your data from the backup snapshot to reduce your loss in extreme disaster situations.
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved

### Learn about the backup setting

Automatic backups is controlled by the backup setting, which is different for free clusters and scalable clusters:
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved

## Backup
| backup setting | free cluster | scalable cluster |
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved
|------------------|--------------|------------------|
| Backup Cycle | Daily | Daily |
| Backup Retention | 1 day | 14 days |
| Backup Time | Fixed time | Configurable |

Automatic backups are scheduled for your TiDB Cloud Serverless clusters according to the backup setting, which can reduce your loss in extreme disaster situations.
- **Backup Cycle** is the frequency at which backups are taken.

### Automatic backup
- Free clusters: the backup cycle is daily.
- Scalable clusters: the backup cycle is daily.

By the automatic backup, you can back up the TiDB Cloud Serverless cluster data every day at the backup time you have set. To set the backup time, perform the following steps:
- **Backup Retention** is the duration for which backups are retained. The expired backups will not be available for restoration.
hfxsd marked this conversation as resolved.
Show resolved Hide resolved

- Free clusters: the backup retention is 1 day.
- Scalable clusters: the backup retention is 14 days.

- **Backup Time** is the time when the backup start to be scheduled. Note that the final backup time may fall behind the configured backup time.
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved

- Free clusters: the backup time is a randomly fixed time.
- Scalable clusters: the backup time can be configured to every half an hour. Default to a randomly fixed time.

### Configure the backup setting

To set the backup time, perform the following steps:
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved

1. Navigate to the **Backup** page of a TiDB Cloud Serverless cluster.

2. Click **Backup Settings**. This will open the **Backup Settings** window, where you can configure the automatic backup settings according to your requirements.

- In **Backup Time**, schedule a start time for the daily cluster backup.
3. In **Backup Time**, schedule a start time for the daily cluster backup.

4. Click **Confirm**.

If you do not specify a preferred backup time, TiDB Cloud assigns a default backup time, which is 2:00 AM in the time zone of the region where the cluster is located.
## Restore

- In **Backup Retention**, configure the minimum backup data retention period.
TiDB Cloud Serverless cluster provides restore functionality to help you recover your data in case of accidental data loss or corruption.
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved

The backup retention period must be set within a range of 7 to 90 days.
### Restore mode

3. Click **Confirm**.
TiDB Cloud Serverless supports snapshot restore and point-in-time restore for your cluster.

### Delete backup files
- **Snapshot Restore**: Restore your cluster from a specific backup snapshot.
hfxsd marked this conversation as resolved.
Show resolved Hide resolved

To delete an existing backup file, perform the following steps:
- **Point-in-Time Restore(beta)**: Restore your cluster to a specific time.
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved

1. Navigate to the **Backup** tab of a cluster.
- Free clusters: not supported.
- Scalable clusters: restore to any time within the last 14 days, but you are not allowed to restore to a time before the cluster creation time or after the current time minus one minute.

2. Click **Delete** for the backup file that you want to delete.
### Restore destination

## Restore
TiDB Cloud Serverless supports restore in-place and restore to a new cluster.
hfxsd marked this conversation as resolved.
Show resolved Hide resolved

**In-place Restore**
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved

Restore to the current cluster, which will overwrite the existing data. Pay attention to the following points:

- The existing connections will be terminated after the restore is triggered.
- The cluster will be unavailable and any new connection will be blocked during the restore process.
- When a restore is performed, tables in the `mysql` schema are also impacted. Hence, any changes made to user credentials and permissions or system variables will be rolled back to the state when the backup was taken.
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved

**Restore to a New Cluster**
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved

Create and restore to the created new cluster. Pay attention to the following points:

- The user credentials and permissions in the source cluster will not be restored to the new cluster.
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved

TiDB Cloud Serverless only supports in-place restoration. To restore your TiDB Cloud Serverless cluster from a backup, follow these steps:
### Perform the restore

To restore your TiDB Cloud Serverless cluster, follow these steps:

1. Navigate to the **Backup** page of a cluster.

Expand All @@ -60,30 +97,50 @@ TiDB Cloud Serverless only supports in-place restoration. To restore your TiDB C
3. In **Restore Mode**, you can choose to restore from a specific backup or any point in time.

<SimpleTab>
<div label="Basic Snapshot Restore">
<div label="Snapshot Restore">

To restore from a selected backup snapshot, take the following steps:

1. Click **Basic Snapshot Restore**.
1. Click **Snapshot Restore**.
2. Select the backup snapshot you want to restore to.
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved

</div>
<div label="Point-in-Time Restore">

This feature lets you restore a cluster to a specific state from any time within the last 90 days.

> **Note:**
>
> The **Point-in-Time Restore** feature is currently in beta.

To restore from a specific point in time, take the following steps:
To restore to a specific point in time, take the following steps:
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved

1. Click **Point-in-Time Restore**.
2. Select the date and time you want to restore to.

</div>
</SimpleTab>

4. Click **Restore** to begin the restoration process.
4. In **Destination**, you can choose to restore in-place or restore to a new cluster.
hfxsd marked this conversation as resolved.
Show resolved Hide resolved

<SimpleTab>
<div label="Restore to a New Cluster">
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved

To restore a new cluster, take the following steps:
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved

1. Click **Restore to a New Cluster**.
2. Enter a name for the new cluster.
3. Choose the cluster plan for the new cluster.
4. Set spending limits when your choice is a scalable cluster.
5. Set the advanced settings as you need when your choice is a scalable cluster.
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved

</div>
<div label="Restore to a New Cluster">
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved

To restore in-place, just click **In-place Restore**.
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved

</div>
</SimpleTab>

5. Click **Restore** to begin the restoration process.
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved

After initiating the restore process, the cluster status changes to **Restoring**. The cluster will be unavailable during the restore process and existing connections will be terminated. Once the restore process completes successfully, you can access the cluster as usual.
After initiating the restore process, the cluster status changes to **Restoring**. The cluster will be unavailable until the restore is complete and cluster status changes to **Available**.
hfxsd marked this conversation as resolved.
Show resolved Hide resolved

## Limitations

- If any TiFlash replica is enabled, the replica will be unavailable for a while after the restore because data needs to be rebuilt in TiFlash.
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved
- Manual backups are not supported for TiDB Cloud Serverless clusters.
2 changes: 1 addition & 1 deletion tidb-cloud/delete-tidb-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You can delete a cluster at any time by performing the following steps:

> **Note:**
>
> [TiDB Cloud Serverless clusters](/tidb-cloud/select-cluster-tier.md#tidb-cloud-serverless) only support [in-place restoring from backups](/tidb-cloud/backup-and-restore-serverless.md#restore) and do not support restoring data after the deletion. If you want to delete a TiDB Cloud Serverless cluster and restore its data in the future, you can use [Dumpling](https://docs.pingcap.com/tidb/stable/dumpling-overview) to export your data as a backup.
> [TiDB Cloud Serverless clusters](/tidb-cloud/select-cluster-tier.md#tidb-cloud-serverless) do not support restoring data after the deletion. If you want to delete a TiDB Cloud Serverless cluster and restore its data in the future, you can use [Dumpling](https://docs.pingcap.com/tidb/stable/dumpling-overview) to export your data as a backup.
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved
shiyuhang0 marked this conversation as resolved.
Show resolved Hide resolved

5. Click **I understand, delete it**.

Expand Down
2 changes: 1 addition & 1 deletion tidb-cloud/tidb-cloud-poc.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Now the workload testing is finished, you can explore more features, for example

- Backup

To avoid vendor lock-in, you can use daily full backup to migrate data to a new cluster and use [Dumpling](https://docs.pingcap.com/tidb/stable/dumpling-overview) to export data. For more information, see [Back Up and Restore TiDB Cloud Dedicated Data](/tidb-cloud/backup-and-restore.md#turn-on-auto-backup) and [Back Up and Restore TiDB Cloud Dedicated Data](/tidb-cloud/backup-and-restore-serverless.md#backup).
To avoid vendor lock-in, you can use daily full backup to migrate data to a new cluster and use [Dumpling](https://docs.pingcap.com/tidb/stable/dumpling-overview) to export data. For more information, see [Back Up and Restore TiDB Cloud Dedicated Data](/tidb-cloud/backup-and-restore.md#turn-on-auto-backup) and [Back Up and Restore TiDB Cloud Serverless Data](/tidb-cloud/backup-and-restore-serverless.md).

## Step 8. Clean up the environment and finish the PoC

Expand Down
Loading