Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
RidRisR committed Nov 28, 2024
1 parent 8e6533e commit 95d1c68
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
8 changes: 6 additions & 2 deletions en/backup-to-aws-s3-using-br.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ Because you already created a `Backup` CR named `demo1-log-backup-s3` when you s
kubectl edit backup demo1-log-backup-s3 -n backup-test
```
In the last line of the CR, change the `logSubcommand` to `log-pause`. Then save and quit the editor. The modified content is as follows:
Change the `logSubcommand` to `log-stop`. Then save and quit the editor. The modified content is as follows:
```yaml
---
Expand All @@ -432,6 +432,7 @@ metadata:
namespace: backup-test
spec:
backupMode: log
logSubcommand: log-stop
br:
cluster: demo1
clusterNamespace: test1
Expand All @@ -457,11 +458,13 @@ demo1-log-backup-s3 log Stopped ....
<Tip>
Stopped is the terminated state of a log backup CR, you couldn't change the state again, but you still could clean log backup data.

In v1.5.5 and earlier TiDB Operator versions, you could use the logStop: true/false field to stop or start a task. This field is retained for backward compatibility.
</Tip>

#### Clean log backup data

1. Because you already created a `Backup` CR named `demo1-log-backup-s3` when you started log backup, you can clean the log data backup by modifying the same `Backup` CR. The priority of all operations is: stop log backup > delete log backup data > start log backup. The following example shows how to clean log backup data generated before 2022-10-10T15:21:00+08:00.
1. Because you already created a `Backup` CR named `demo1-log-backup-s3` when you started log backup, you can clean the log data backup by modifying the same `Backup` CR. The following example shows how to clean log backup data generated before 2022-10-10T15:21:00+08:00.

```shell
kubectl edit backup demo1-log-backup-s3 -n backup-test
Expand All @@ -478,6 +481,7 @@ Stopped is the terminated state of a log backup CR, you couldn't change the stat
namespace: backup-test
spec:
backupMode: log
logSubcommand: log-start/log-pause/log-stop
br:
cluster: demo1
clusterNamespace: test1
Expand Down
2 changes: 1 addition & 1 deletion zh/backup-restore-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ kubectl delete backupschedule ${name} -n ${namespace}

如果你使用 v1.1.2 及以前版本,或使用 v1.1.3 及以后版本并将 `spec.cleanPolicy` 设置为 `Delete` 时,TiDB Operator 在删除 CR 时会同时清理备份文件。

如果你使用v1.5及以后的版本,当你删除CR时,TiDB Operator会尝试自动停止正在运行的日志备份任务。自动停止功能只会停止正常运行的日志备份任务,并不处理错误或者失败的任务。
如果你使用 v1.5.5, v1.6.1 及以后的版本,当你删除CR时,TiDB Operator 会尝试自动停止正在运行的日志备份任务。自动停止功能只会停止正常运行的日志备份任务,并不处理错误或者失败的任务。

如果你使用基于 AWS EBS 卷快照的备份,并将 `spec.cleanPolicy` 设置为 `Delete` 时,TiDB Operator 在删除 CR 以及清理备份文件的同时删除 AWS 上相关的所有卷快照。

Expand Down
9 changes: 6 additions & 3 deletions zh/backup-to-aws-s3-using-br.md
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ demo1-log-backup-s3 log Running ....
kubectl edit backup demo1-log-backup-s3 -n backup-test
```

在 CR 的最后一行,将 logSubcommand 更改为 log-pause。然后保存并退出编辑器。修改后的内容如下:
将 logSubcommand 更改为 log-stop。然后保存并退出编辑器。修改后的内容如下:

```yaml
---
Expand All @@ -428,6 +428,7 @@ metadata:
namespace: backup-test
spec:
backupMode: log
logSubcommand: log-stop
br:
cluster: demo1
clusterNamespace: test1
Expand All @@ -438,7 +439,6 @@ spec:
region: us-west-1
bucket: my-bucket
prefix: my-log-backup-folder
logStop: true
```
可以看到名为 `demo1-log-backup-s3` 的 `Backup` CR 的 `STATUS` 从 `Running` 变成了 `Stopped`:
Expand All @@ -454,11 +454,13 @@ demo1-log-backup-s3 log Stopped ....
<Tip>
Stopped 是日志备份的终止状态,此状态下无法再次更改状态,但你仍然可以清理日志备份的数据。
在 v1.5.5 及更早版本的 TiDB Operator 中,可以使用 logStop: true/false 字段来停止或启动任务。此字段为了向后兼容而保留。
</Tip>
#### 清理日志备份数据
1. 由于你在开启日志备份的时候已经创建了名为 `demo1-log-backup-s3` 的 `Backup` CR,因此可以直接更新该 `Backup` CR 的配置,来激活清理日志备份数据的操作。操作激活优先级从高到低分别是停止日志备份任务、删除日志备份数据和开启日志备份任务。执行如下操作来清理 2022-10-10T15:21:00+08:00 之前的所有日志备份数据。
1. 由于你在开启日志备份的时候已经创建了名为 `demo1-log-backup-s3` 的 `Backup` CR,因此可以直接更新该 `Backup` CR 的配置,来激活清理日志备份数据的操作。执行如下操作来清理 2022-10-10T15:21:00+08:00 之前的所有日志备份数据。
```shell
kubectl edit backup demo1-log-backup-s3 -n backup-test
Expand All @@ -475,6 +477,7 @@ Stopped 是日志备份的终止状态,此状态下无法再次更改状态,
namespace: backup-test
spec:
backupMode: log
logSubcommand: log-start/log-pause/log-stop
br:
cluster: demo1
clusterNamespace: test1
Expand Down

0 comments on commit 95d1c68

Please sign in to comment.