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

Add description for auto detect mode of online recovery #10979

Merged
merged 5 commits into from
Aug 19, 2022
Merged
Changes from all 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
14 changes: 10 additions & 4 deletions online-unsafe-recovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ summary: 如何使用 Online Unsafe Recovery。

> **警告:**
>
> 此功能为有损恢复,无法保证数据和数据索引完整性。
> - 此功能为有损恢复,无法保证数据索引一致性和事务完整性,若有问题需要额外的工具或者步骤进行相应修复。
Oreoxmt marked this conversation as resolved.
Show resolved Hide resolved
> - 该功能自 v6.1.0 版本开始引入。在 TiDB v6.1 以下版本为实验特性,行为与本文描述有区别,**不推荐**使用。在其他版本使用该功能时,请参考相应版本文档。

当多数副本的永久性损坏造成部分数据不可读写时,可以使用 Online Unsafe Recovery 功能进行数据有损恢复。
当多数副本的永久性损坏造成部分数据不可读写时,可以使用 Online Unsafe Recovery 功能进行数据有损恢复,使 TiKV 正常提供服务

## 功能说明

Expand Down Expand Up @@ -53,6 +54,8 @@ pd-ctl -u <pd_addr> unsafe remove-failed-stores <store_id1,store_id2,...>

可通过 `--timeout <seconds>` 指定可允许执行恢复的最长时间。若未指定,默认为 5 分钟。当超时后,恢复中断报错。

若 PD 进行过灾难性恢复 [`pd-recover`](/pd-recover.md) 操作,丢失了无法恢复的 TiKV 节点的 store 信息,因此无法确定要传的 store ID 时,可指定 `--auto-detect` 参数允许传入一个空的 store ID 列表。在该模式下,所有未在 PD store 列表中的 store ID 均被认为无法恢复,进行移除。

> **注意:**
>
> - 由于此命令需要收集来自所有 Peer 的信息,可能会造成 PD 短时间内有明显的内存使用量上涨(10 万个 Peer 预计使用约 500 MiB 内存)。
Expand Down Expand Up @@ -84,8 +87,11 @@ pd-ctl -u <pd_addr> unsafe remove-failed-stores show
```json
[
{
"info": "Unsafe recovery enters collect report stage: failed stores 4, 5, 6",
"time": "......"
"info": "Unsafe recovery enters collect report stage",
"time": "......",
"details" : [
"failed stores 4, 5, 6",
]
},
{
"info": "Unsafe recovery enters force leader stage",
Expand Down