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

Description and instruction of br compact backup #2676

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
s3 part demo
RidRisR committed Jan 17, 2025
commit 215674b180447607890352631330d059016cb603
53 changes: 53 additions & 0 deletions en/backup-to-aws-s3-using-br.md
Original file line number Diff line number Diff line change
@@ -424,7 +424,60 @@ You can also stop log backup by taking the same steps as in [Start log backup](#

### Compact Backup

You can use a `CompactBackup` CR to compress log backup data into SST format, which accelerates Point in Time Restore (PiTR).

This section builds on the previous example of log backup and introduces how to use compact log backup.

1. In the `backup-test` namespace, create a `CompactBackup` CR named `demo1-compact-backup`.

```shell
kubectl apply -f compact-backup-demo1.yaml
```

The content of `compact-backup-demo1.yaml` is as follows:

```yaml
---
apiVersion: pingcap.com/v1alpha1
kind: CompactBackup
metadata:
name: demo1-compact-backup
namespace: backup-test
spec:
startTs: "***"
endTs: "***"
concurrency: 8
maxRetryTimes: 2
br:
cluster: demo1
clusterNamespace: test1
sendCredToTikv: true
s3:
provider: aws
secretName: s3-secret
region: us-west-1
bucket: my-bucket
prefix: my-log-backup-folder
```

The `startTs` and `endTs` fields define the time range for the logs to be compacted by `demo1-compact-backup`. Any log that contains at least one write within this time range will be included in the compression process. As a result, the compacted data may include writes outside this time range.

#### View the compact log backup status

After creating the `CompactBackup` CR, TiDB Operator automatically starts compacting the log backup. You can check the backup status using the following command:

```shell
kubectl get cpbk -n backup-test
```

From the output, you can find the status of the CompactBackup CR named demo1-compact-backup, similar to the following:

```
NAME STATUS PROGRESS MESSAGE
demo1-compact-backup Complete [READ_META(17/17),COMPACT_WORK(1291/1291)]
```

If the STATUS field displays Complete, the compact log backup process has finished successfully.

### Backup CR examples

10 changes: 9 additions & 1 deletion zh/backup-to-aws-s3-using-br.md
Original file line number Diff line number Diff line change
@@ -462,10 +462,18 @@ demo1-log-backup-s3 log Stopped ....

创建好 `CompactBackup` CR之后,TiDB operator将会自动开始压缩日志备份。你可以通过如下命令查看备份状态:

```shell
kubectl get cpbk -n backup-test
```

从上述命令的输出中,你可以找到描述名为 `demo1-compact-backup` 的 `CompactBackup` CR 的信息, 形式大致如下:

```
NAME STATUS PROGRESS MESSAGE
demo1-compact-backup Complete [READ_META(17/17),COMPACT_WORK(1291/1291)]
```


如果 `STATUS` 字段显示为 `Complete` 则代表压缩日志备份已经完成。

### 备份示例